This commit is contained in:
Zel
2025-02-23 18:47:21 +08:00
parent eaaffeeccb
commit e46a7ca31c
104 changed files with 2630 additions and 2516 deletions

View File

@@ -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;
}
}
}
}