- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
char[] splitter = { ',' };
string types = hashtable[FlagsEnumValue].ToString();
string[] typesStringArray = types.Split(splitter, StringSplitOptions.RemoveEmptyEntries);
ArrayList typesArray = new ArrayList();
foreach (string str in typesStringArray)
{
foreach (string type in Enum.GetNames(typeof(FlagsEnum)))
{
if (type == str.Trim())
{
typesArray.Add((FlagsEnum)Enum.Parse(typeof(FlagsEnum), str, true));
break;
}
}
}
foreach (FlagsEnum type in typesArray)
{
if ((someObject.field & type) > 0)
{
typeFound = true;
}
else
{
typeFound = false;
break;
}
}
Follow us!