System.Enum.GetHashCode C# (CSharp) Метод

GetHashCode() публичный Метод

public GetHashCode ( ) : int
Результат int
        public override int GetHashCode()
        {
            return GetValue().GetHashCode();
        }

Usage Example

Пример #1
0
 /// <summary>
 /// 位域枚举是否包含指定的值,true:包含。
 /// .net中可以直接使用HasFlag判定
 /// </summary>
 public static bool Has(this Enum value, Enum target)
 {
     Guard.ArgumentNotNull(value, "Enum value");
     Guard.ArgumentNotNull(target, "Enum target");
     if (value.GetType() != target.GetType())
     {
         return(false);
     }
     return((value.GetHashCode() & target.GetHashCode()) == target.GetHashCode());
 }
All Usage Examples Of System.Enum::GetHashCode