Skip to content

Commit

Permalink
重构 LocalizedString 类及其属性
Browse files Browse the repository at this point in the history
将 LocalizedString 类从继承 HtmlString 改为构造函数继承 HtmlString,并添加了 XML 注释。删除了原来的 Text 属性和构造函数,并将 Text 属性改为可空类型 String?,并在声明时初始化。
  • Loading branch information
猿人易 committed Nov 26, 2024
1 parent ee6973a commit 135e886
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions Pek.AspNetCore/Localization/LocalizedString.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,14 @@ namespace Pek.Localization;
/// <summary>
/// 本地化字符串
/// </summary>
public class LocalizedString : HtmlString
/// <remarks>
/// 实例化
/// </remarks>
/// <param name="localized">本地化内容</param>
public class LocalizedString(String? localized) : HtmlString(localized)
{
/// <summary>
/// 文本内容
/// </summary>
public string Text { get; }

/// <summary>
/// 实例化
/// </summary>
/// <param name="localized">本地化内容</param>
public LocalizedString(string localized) : base(localized)
{
Text = localized;
}
public String? Text { get; } = localized;
}

0 comments on commit 135e886

Please sign in to comment.