Get Enum - CSharp System

CSharp examples for System:Enum

Description

Get Enum

Demo Code


using System.Threading.Tasks;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;/*from   w w  w  . j  a  va 2  s. c  o m*/

public class Main{
        public static T GetEnum<T>(int value)
        {
            return (T)Enum.ToObject(typeof(T), value);
        }
}

Related Tutorials