示例#1
0
        public override bool Equals(object obj)
        {
            AbstractTypeSafeEnum otherObj = obj as AbstractTypeSafeEnum;

            if (otherObj != null && otherObj.GetType().Equals(GetType()))
            {
                return(otherObj.Value == Value);
            }

            return(false);
        }
示例#2
0
 public static bool IsSet(AbstractTypeSafeEnum enumToCheck, AbstractTypeSafeEnum flagToCheckFor)
 {
     if (!SupportsMultipleValues(enumToCheck.GetType()))
     {
         //   throw new ArgumentException(Resources.EnumDoesNotSupportMultipleValues);
     }
     if (flagToCheckFor.Value.Contains(EnumValueSeparator) && !enumToCheck.Value.Contains(EnumValueSeparator))
     {
         return((enumToCheck._flagValue & flagToCheckFor._flagValue) == enumToCheck._flagValue);
     }
     else
     {
         return((enumToCheck._flagValue & flagToCheckFor._flagValue) == flagToCheckFor._flagValue);
     }
 }