/// <summary> /// 获取 <see cref="System.UInt64"/> 类型的枚举值。 /// </summary> /// <param name="value">要获取的枚举值。</param> /// <returns><see cref="System.UInt64"/> 类型的枚举值。</returns> private static ulong ToUInt64(object value) { switch (Convert.GetTypeCode(value)) { case TypeCode.SByte: case TypeCode.Int16: case TypeCode.Int32: case TypeCode.Int64: return((ulong)Convert.ToInt64(value, CultureInfo.InvariantCulture)); case TypeCode.Byte: case TypeCode.UInt16: case TypeCode.UInt32: case TypeCode.UInt64: return(Convert.ToUInt64(value, CultureInfo.InvariantCulture)); } throw ExceptionHelper.UnknownEnumType(); }