/// <summary> /// Return the description for the enum entry with value index. /// </summary> /// <param name="index">The index.</param> /// <returns></returns> public static string GetRoleName(int index) { string s = Enum.GetName(typeof(SpecialPortalRoles), index); SpecialPortalRoles desc = (SpecialPortalRoles)Enum.Parse(typeof(SpecialPortalRoles), s); return(GetDescription(desc)); }
/// <summary> /// Add the special roles found in SpecialPortalRoles /// </summary> /// <param name="listRoles">The list roles.</param> public static void populateSpecialRoles(ref CheckBoxList listRoles) { foreach (string s in Enum.GetNames(typeof(SpecialPortalRoles))) { SpecialPortalRoles desc = (SpecialPortalRoles)Enum.Parse(typeof(SpecialPortalRoles), s); string stringDesc = GetDescription(desc); listRoles.Items.Add(new ListItem (stringDesc, ((int)Enum.Parse(typeof(SpecialPortalRoles), s)).ToString())); } }