123123
This commit is contained in:
@@ -2,27 +2,33 @@
|
||||
{
|
||||
public class PageReference
|
||||
{
|
||||
/// <summary>
|
||||
/// The name of the page. Such as "Sand Box" or "Some Namespace : SandBox".
|
||||
/// </summary>
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The namespace part of the Name.
|
||||
/// </summary>
|
||||
public string Namespace { get; set; } = string.Empty;
|
||||
|
||||
/// The cleaned up version of the name, safe for passing in URLs.
|
||||
public string Navigation { get; set; } = string.Empty;
|
||||
|
||||
public PageReference()
|
||||
{
|
||||
Name = string.Empty;
|
||||
Namespace = string.Empty;
|
||||
Navigation = string.Empty;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string Namespace { get; set; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string Navigation { get; set; }
|
||||
|
||||
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
return obj is PageReference other
|
||||
&& string.Equals(Navigation, other.Navigation, StringComparison.OrdinalIgnoreCase);
|
||||
&& string.Equals(Navigation, other.Navigation, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
@@ -30,6 +36,12 @@
|
||||
return Navigation.GetHashCode();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="navigation"></param>
|
||||
/// <exception cref="Exception"></exception>
|
||||
public PageReference(string name, string navigation)
|
||||
{
|
||||
var parts = name.Split("::");
|
||||
@@ -45,10 +57,10 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception($"Invalid page name {name}");
|
||||
throw new Exception($"页面名称无效: {name}");
|
||||
}
|
||||
|
||||
Navigation = navigation;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user