优化更新代码,添加界面功能并整合

This commit is contained in:
GG Z
2025-02-10 20:53:40 +08:00
parent 83b846f15f
commit 978e03a67f
1389 changed files with 95739 additions and 22200 deletions

View File

@@ -0,0 +1,44 @@
using WPFluent.Controls;
using System.Text;
namespace WPFluent.Extensions;
/// <summary>
/// Set of extensions for the enumeration of icons to facilitate their management and replacement.
/// </summary>
public static class SymbolExtensions
{
/// <summary>
/// Converts <see cref="SymbolRegular"/> to <see langword="string"/> based on the ID.
/// </summary>
public static string GetString(this SymbolRegular icon)
{ return Encoding.Unicode.GetString(BitConverter.GetBytes((int)icon)).TrimEnd('\0'); }
/// <summary>
/// Converts <see cref="SymbolFilled"/> to <see langword="string"/> based on the ID.
/// </summary>
public static string GetString(this SymbolFilled icon)
{ return Encoding.Unicode.GetString(BitConverter.GetBytes((int)icon)).TrimEnd('\0'); }
/// <summary>
/// Replaces <see cref="SymbolRegular"/> with <see cref="SymbolFilled"/>.
/// </summary>
public static SymbolFilled Swap(this SymbolRegular icon)
{
// It is possible that the alternative icon does not exist
return SymbolGlyph.ParseFilled(icon.ToString());
}
/// <summary>
/// Replaces <see cref="SymbolFilled"/> with <see cref="SymbolRegular"/>.
/// </summary>
public static SymbolRegular Swap(this SymbolFilled icon)
{
// It is possible that the alternative icon does not exist
return SymbolGlyph.Parse(icon.ToString());
}
}