CSharp examples for System:Enum
Has Any Flag from Enum
using System.Text; using System.IO;/*from w ww . j av a2 s . c o m*/ using System.Globalization; using System.Collections.Generic; using System; public class Main{ public static bool HasAnyFlag(this Enum value, Enum toTest) { var val = ((IConvertible)value).ToUInt64(null); var test = ((IConvertible)toTest).ToUInt64(null); return (val & test) != 0; } }