Is possible list a flag based in combination.
Using ProfileTypeFlag.SupplierMaster get a list just of "Supplier | Master | External"
I'm trying use this code. But they return all enums;
public List<string> SetRoles(ProfileTypeFlag role)
{
List<string> result = new List<string>();
foreach (ProfileTypeFlag r in Enum.GetValues(typeof(ProfileTypeFlag)))
{
if ((role & r) != 0) result.Add(r.ToString());
}
return result;
}
[Flags]
public enum ProfileTypeFlag : uint
{
None = 0,
Customer = 1,
Supplier = 2,
Internal = 4,
Delegate = 8,
Master = 16,
External = 32,
CustomerMaster = Customer | Master | External,
SupplierMaster = Supplier | Master | External
}