mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-27 03:33:25 +08:00
Flowchart
This commit is contained in:
@@ -6,6 +6,17 @@ namespace AIStudio.Wpf.DiagramDesigner
|
||||
{
|
||||
public static class EnumExtension
|
||||
{
|
||||
/// <summary>
|
||||
/// Converts to enum.
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="str">The string.</param>
|
||||
/// <returns></returns>
|
||||
public static T ToEnum<T>(this string str)
|
||||
{
|
||||
return (T)Enum.Parse(typeof(T), str);
|
||||
}
|
||||
|
||||
public static string GetDescription(this Enum value)
|
||||
{
|
||||
FieldInfo field = value.GetType().GetField(value.ToString());
|
||||
|
||||
Reference in New Issue
Block a user