// string to enum
EAccountRole var = (EAccountRole)Enum.Parse(typeof(EAccountRole), RoleManage.Instance.CurrentAccount.Role);
// enum to list
public IEnumerable<EAccountRole> RoleList
{
get
{
if (RoleManage.Instance.CurrentLoginRole == EAccountRole.IV)
{
//super
return Enum.GetValues(typeof(EAccountRole)).Cast<EAccountRole>().Where(f => f != EAccountRole.IV);
}
else
{
//admin
return Enum.GetValues(typeof(EAccountRole)).Cast<EAccountRole>().Where(f => f != EAccountRole.IV || f != EAccountRole.III);
}
}
}