/// <summary> /// Converts a uint to a specified enumeration <typeparamref name="T"/> /// </summary> /// <typeparam name="T">Enumeration Type</typeparam> /// <param name="value">value to convert</param> /// <returns><paramref name="value"/> as the enumeration type</returns> public static T FromUInt32 <T>(uint value) where T : struct, E => EnumCompiledCache <T> .FromUInt32(value);
/// <summary> /// Converts a ulong to a specified enumeration <typeparamref name="T"/> /// </summary> /// <typeparam name="T">Enumeration Type</typeparam> /// <param name="value">value to convert</param> /// <returns><paramref name="value"/> as the enumeration type</returns> public static T FromUInt64 <T>(ulong value) where T : struct, E => EnumCompiledCache <T> .FromUInt64(value);
/// <summary> /// Bitwise Exclusive OR /// </summary> /// <typeparam name="T">An enumeration type</typeparam> /// <param name="left">An enumeration value</param> /// <param name="right">An enumeration value</param> /// <returns><c>left ^ right</c></returns> public static T BitwiseExclusiveOr <T>(T left, T right) where T : struct, E => EnumCompiledCache <T> .BitwiseExclusiveOr(left, right);
/// <summary> /// Converts a ushort to a specified enumeration <typeparamref name="T"/> /// </summary> /// <typeparam name="T">Enumeration Type</typeparam> /// <param name="value">value to convert</param> /// <returns><paramref name="value"/> as the enumeration type</returns> public static T FromUInt16 <T>(ushort value) where T : struct, E => EnumCompiledCache <T> .FromUInt16(value);
/// <summary> /// Converts the value of the specified enumeration to an unsigned int. /// </summary> /// <typeparam name="T">An enumeration type</typeparam> /// <param name="value">An enumeration value</param> /// <returns>A 32-bit unsigned integer that is cast equivalent to the enumeration value</returns> public static uint ToUInt32 <T>(T value) where T : struct, E => EnumCompiledCache <T> .ToUInt32(value);
/// <summary> /// Converts the value of the specified enumeration to a float. /// </summary> /// <typeparam name="T">An enumeration type</typeparam> /// <param name="value">An enumeration value</param> /// <returns>A single precision floating point number that is case equivalent to the enumeration value</returns> public static float ToSingle <T>(T value) where T : struct, E => EnumCompiledCache <T> .ToSingle(value);
/// <summary> /// Returns an indication whether a constant with a specified value exists in a specified /// enumeration. /// </summary> /// <typeparam name="T">An enumeration type</typeparam> /// <param name="value">An enumeration value</param> /// <returns> /// <c>true</c> if <paramref name="value"/> is valid for <typeparamref name="T"/>. /// </returns> public static bool IsDefined <T>(int value) where T : struct, E => EnumCompiledCache <T> .IsDefinedInt32(value);
/// <summary> /// Converts the value of the specified enumeration to a signed byte. /// </summary> /// <typeparam name="T">An enumeration type</typeparam> /// <param name="value">An enumeration value</param> /// <returns>An 8-bit unsigned integer that is cast equivalent to the enumeration value</returns> public static sbyte ToSByte <T>(T value) where T : struct, E => EnumCompiledCache <T> .ToSByte(value);
/// <summary> /// Returns an indication whether a constant with a specified value exists in a specified /// enumeration. /// </summary> /// <typeparam name="T">An enumeration type</typeparam> /// <param name="value">An enumeration value</param> /// <returns> /// <c>true</c> if <paramref name="value"/> is valid for <typeparamref name="T"/>. /// </returns> public static bool IsDefined <T>(byte value) where T : struct, E => EnumCompiledCache <T> .IsDefinedByte(value);
/// <summary> /// Returns an indication whether a constant with a specified value exists in a specified /// enumeration. /// </summary> /// <typeparam name="T">An enumeration type</typeparam> /// <param name="value">An enumeration value</param> /// <returns> /// <c>true</c> if <paramref name="value"/> is valid for <typeparamref name="T"/>. /// </returns> public static bool IsDefined <T>(ushort value) where T : struct, E => EnumCompiledCache <T> .IsDefinedUInt16(value);
/// <summary> /// Returns the result of bitwise and for value and bitwise not of the flag. /// </summary> /// <typeparam name="T">An enumeration type</typeparam> /// <param name="value">An enumeration value</param> /// <param name="flag">An enumeration value</param> /// <returns>Value with the specified flag unset</returns> public static T UnsetFlag <T>(T value, T flag) where T : struct, E => EnumCompiledCache <T> .UnsetFlag(value, flag);
/// <summary> /// Checks whether a flag exists. /// This function does not check for <c>FlagsAttribute</c>. /// </summary> /// <typeparam name="T">An enumeration type</typeparam> /// <param name="value">An enumeration value</param> /// <param name="flag">An enumeration value</param> /// <returns> /// true if the bit field or bit fields that are set in flag are also set in the current instance; otherwise, false. /// </returns> public static bool HasFlag <T>(T value, T flag) where T : struct, E => EnumCompiledCache <T> .HasFlag(value, flag);
/// <summary> /// Bitwise NOT /// </summary> /// <typeparam name="T">An enumeration type</typeparam> /// <param name="value">An enumeration value</param> /// <returns><c>~value</c></returns> public static T BitwiseNot <T>(T value) where T : struct, E => EnumCompiledCache <T> .BitwiseNot(value);
/// <summary> /// Converts a float to a specified enumeration <typeparamref name="T"/> /// </summary> /// <typeparam name="T">Enumeration Type</typeparam> /// <param name="value">value to convert</param> /// <returns><paramref name="value"/> as the enumeration type</returns> public static T FromSingle <T>(float value) where T : struct, E => EnumCompiledCache <T> .FromSingle(value);
/// <summary> /// Returns an indication whether a constant with a specified value exists in a specified /// enumeration. /// </summary> /// <typeparam name="T">An enumeration type</typeparam> /// <param name="value">An enumeration value</param> /// <returns> /// <c>true</c> if <paramref name="value"/> is valid for <typeparamref name="T"/>. /// </returns> public static bool IsDefined <T>(ulong value) where T : struct, E => EnumCompiledCache <T> .IsDefinedUInt64(value);
/// <summary> /// Converts a double to a specified enumeration <typeparamref name="T"/> /// </summary> /// <typeparam name="T">Enumeration Type</typeparam> /// <param name="value">value to convert</param> /// <returns><paramref name="value"/> as the enumeration type</returns> public static T FromDouble <T>(double value) where T : struct, E => EnumCompiledCache <T> .FromDouble(value);
/// <summary> /// Returns an idication whether a constant with a specified value exists in a specified /// enumeration /// </summary> /// <typeparam name="T">An enumeration type</typeparam> /// <param name="value">An enumeration value</param> /// <returns> /// <c>true</c> if <paramref name="value"/> is valid for <typeparamref name="T"/>. /// </returns> public static bool IsDefined <T>(float value) where T : struct, E => EnumCompiledCache <T> .IsDefinedSingle(value);
/// <summary> /// Converts the value of the specified enumeration to an unsigned short. /// </summary> /// <typeparam name="T">An enumeration type</typeparam> /// <param name="value">An enumeration value</param> /// <returns>A 16-bit unsigned integer that is cast equivalent to the enumeration value</returns> public static ushort ToUInt16 <T>(T value) where T : struct, E => EnumCompiledCache <T> .ToUInt16(value);
/// <summary> /// Returns an idication whether a constant with a specified value exists in a specified /// enumeration /// </summary> /// <typeparam name="T">An enumeration type</typeparam> /// <param name="value">An enumeration value</param> /// <returns> /// <c>true</c> if <paramref name="value"/> is valid for <typeparamref name="T"/>. /// </returns> public static bool IsDefined <T>(double value) where T : struct, E => EnumCompiledCache <T> .IsDefinedDouble(value);
/// <summary> /// Converts the value of the specified enumeration to an unsigned long. /// </summary> /// <typeparam name="T">An enumeration type</typeparam> /// <param name="value">An enumeration value</param> /// <returns>A 64-bit unsigned integer that is cast equivalent to the enumeration value</returns> public static ulong ToUInt64 <T>(T value) where T : struct, E => EnumCompiledCache <T> .ToUInt64(value);
/// <summary> /// Converts a sbyte to a specified enumeration <typeparamref name="T"/> /// </summary> /// <typeparam name="T">Enumeration Type</typeparam> /// <param name="value">value to convert</param> /// <returns><paramref name="value"/> as the enumeration type</returns> public static T FromSByte <T>(sbyte value) where T : struct, E => EnumCompiledCache <T> .FromSByte(value);
/// <summary> /// Converts the value of the specified enumeration to a double. /// </summary> /// <typeparam name="T">An enumeration type</typeparam> /// <param name="value">An enumeration value</param> /// <returns>A double precision floating point number that is case equivalent to the enumeration value</returns> public static double ToDouble <T>(T value) where T : struct, E => EnumCompiledCache <T> .ToDouble(value);
/// <summary> /// Bitwise AND /// </summary> /// <typeparam name="T">An enumeration type</typeparam> /// <param name="left">An enumeration value</param> /// <param name="right">An enumeration value</param> /// <returns><c>left & right</c></returns> public static T BitwiseAnd <T>(T left, T right) where T : struct, E => EnumCompiledCache <T> .BitwiseAnd(left, right);