Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# class where T : enum C# 7.03

public static Dictionary<int, string> EnumNamedValues<T>() where T : System.Enum
{
    var result = new Dictionary<int, string>();
    var values = Enum.GetValues(typeof(T));

    foreach (int item in values)
        result.Add(item, Enum.GetName(typeof(T), item));
    return result;
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: how to move the camera rotation in phone in c# by touch 
Csharp :: web socket background.js example 
Csharp :: firepower 4125 License update 
Csharp :: satisfactory controller support 
Csharp :: binary addition c# 
Csharp :: open aspx page c# 
Csharp :: c# sha512 salt 
Csharp :: c# compare 2 binary files 
Csharp :: compare 0001/01/01 in c# 
Csharp :: C# console out restore 
Csharp :: Library dll unless netloaded by AutoCAD 
Csharp :: C:UsersSherryDocumentssdata.dta 
Csharp :: how to add the ssl certificate in vb.net application 
Csharp :: get fixedupdate interval unity 
Csharp :: properties vs field c# 
Csharp :: Unity PlayOneShoot Audio 
Csharp :: localhost ssl certificate error in visual studio 2022 .net 6 
Csharp :: user input in c# 
Csharp :: Program to find GCD or HCF of two numbers c# 
Csharp :: kendo razor textbox 
Csharp :: player leaning unity 
Csharp :: Function delegate 
Csharp :: Avoid auto-filling persian time picker 
Csharp :: c# extension method in non static class 
Csharp :: unity mass unit 
Csharp :: what is string args in c# 
Csharp :: Reading a date from xlsx using open xml sdk 
Csharp :: c# make a negative number positive 
Csharp :: c# blazor in .net framework 
Csharp :: c# use enum in class 
ADD CONTENT
Topic
Content
Source link
Name
7+7 =