Ejemplo n.º 1
0
 public static bool AnyFlag(this Enum baseEnum, Enum value)
 {
     if (!Type.GetTypeHandle(baseEnum).Equals(Type.GetTypeHandle(value)))
     {
         throw CommonExceptions.EnumTypeDoesNotMatch("value", value.GetType(), baseEnum.GetType());
     }
     return((ToUInt64(baseEnum) & ToUInt64(value)) != 0);
 }
Ejemplo n.º 2
0
 public static bool AnyFlag(this Enum baseEnum, Enum value)
 {
     CommonExceptions.CheckArgumentNull(baseEnum, "baseEnum");
     CommonExceptions.CheckArgumentNull(value, "value");
     Contract.EndContractBlock();
     if (baseEnum.GetType() != value.GetType())
     {
         throw CommonExceptions.EnumTypeDoesNotMatch("value", value.GetType(), baseEnum.GetType());
     }
     return((ToUInt64((object)baseEnum) & ToUInt64((object)value)) != 0);
 }
Ejemplo n.º 3
0
 public static bool AnyFlag(this Enum baseEnum, Enum value)
 {
     if (baseEnum == null)
     {
         throw CommonExceptions.ArgumentNull("baseEnum");
     }
     if (value == null)
     {
         throw CommonExceptions.ArgumentNull("value");
     }
     Contract.EndContractBlock();
     if (baseEnum.GetType() != value.GetType())
     {
         throw CommonExceptions.EnumTypeDoesNotMatch("value", value.GetType(), baseEnum.GetType());
     }
     return((ToUInt64(baseEnum) & ToUInt64(value)) != 0);
 }