• ASP.NET Core API
  • Core API
  • Mail API
  • Json API
  • Core API
  • Cuemon
  • EnumUtility

    Show / Hide Table of Contents
    • Cuemon
      • ActionFactory
      • ActionFactory<TTuple>
      • ArgumentEmptyException
      • AssignmentOperator
      • AssignmentUtility
      • ByteConverter
      • ByteConverterExtensions
      • ByteExtensions
      • ByteUtility
      • ByteUtilityExtensions
      • CasingMethod
      • CharConverter
      • CharConverterExtensions
      • Condition
      • ConditionBuilder<TTuple>
      • ConditionExtensions
      • Converter
      • ConverterExtensions
      • ConvertibleConverter
      • ConvertibleConverterExtensions
      • DataPair
      • DataPair<T>
      • DateSpan
      • DateTimeConverter
      • DateTimeConverterExtensions
      • DateTimeExtensions
      • DateTimeFormatPattern
      • DayPart
      • DayParts
      • DelegateUtility
      • DelegateUtilityExtensions
      • DoubleConverter
      • DoubleConverterExtensions
      • EnumUtility
      • EnumUtilityExtensions
      • EventUtility
      • ExceptionUtility
      • ExceptionUtilityExtensions
      • FuncFactory
      • FuncFactory<TTuple, TResult>
      • GuidConverter
      • GuidConverterExtensions
      • GuidFormats
      • GuidUtility
      • Hierarchy<T>
      • HierarchyExtensions
      • HierarchySerializer
      • HierarchyUtility
      • HorizontalDirection
      • IData
      • IHierarchy<T>
      • IndexMapping
      • Initializer
      • InitializerBuilder<T>
      • IntegerExtensions
      • IWrapper<T>
      • LatencyException
      • LoopUtility
      • Mapping
      • MappingExtensions
      • MethodWrappedException
      • NumberUtility
      • NumberUtilityExtensions
      • ObjectConverter
      • PreambleSequence
      • RandomSeverity
      • RelationalOperator
      • RoundOffAccuracy
      • SortOrder
      • StandardizedDateTimeFormatPattern
      • StringConverter
      • StringConverterExtensions
      • StringExtensions
      • StringFormatter
      • StringReplacePair
      • StringUtility
      • StringUtilityExtensions
      • StructUtility
      • StructUtilityExtensions
      • TaskActionFactory
      • TaskActionFactory<TTuple>
      • TaskFuncFactory
      • TaskFuncFactory<TTuple, TResult>
      • Template
      • Template<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>
      • Template<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>
      • Template<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>
      • Template<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>
      • Template<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>
      • Template<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>
      • Template<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>
      • Template<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>
      • Template<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>
      • Template<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>
      • Template<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>
      • Template<T1, T2, T3, T4, T5, T6, T7, T8, T9>
      • Template<T1, T2, T3, T4, T5, T6, T7, T8>
      • Template<T1, T2, T3, T4, T5, T6, T7>
      • Template<T1, T2, T3, T4, T5, T6>
      • Template<T1, T2, T3, T4, T5>
      • Template<T1, T2, T3, T4>
      • Template<T1, T2, T3>
      • Template<T1, T2>
      • Template<T1>
      • TemplateFactory<TTuple>
      • TesterDoer
      • TesterFunc<T, TResult, TSuccess>
      • TesterFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, TResult, TSuccess>
      • TesterFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, TResult, TSuccess>
      • TesterFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, TResult, TSuccess>
      • TesterFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, TResult, TSuccess>
      • TesterFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, TResult, TSuccess>
      • TesterFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, TResult, TSuccess>
      • TesterFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, TResult, TSuccess>
      • TesterFunc<T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult, TSuccess>
      • TesterFunc<T1, T2, T3, T4, T5, T6, T7, T8, TResult, TSuccess>
      • TesterFunc<T1, T2, T3, T4, T5, T6, T7, TResult, TSuccess>
      • TesterFunc<T1, T2, T3, T4, T5, T6, TResult, TSuccess>
      • TesterFunc<T1, T2, T3, T4, T5, TResult, TSuccess>
      • TesterFunc<T1, T2, T3, T4, TResult, TSuccess>
      • TesterFunc<T1, T2, T3, TResult, TSuccess>
      • TesterFunc<T1, T2, TResult, TSuccess>
      • TesterFunc<TResult, TSuccess>
      • TesterFuncFactory
      • TesterFuncFactory<TTuple, TResult, TSuccess>
      • TesterFuncUtility
      • TimeRange
      • TimeSpanConverter
      • TimeSpanConverterExtensions
      • TimeSpanExtensions
      • TimeUnit
      • TransientFaultEvidence
      • TransientFaultException
      • TransientOperation
      • TransientOperationOptions
      • TupleUtility
      • Tweaker
      • TweakerExtensions
      • TypeArgumentException
      • TypeArgumentOutOfRangeException
      • TypeCodeConverter
      • TypeCodeConverterExtensions
      • TypeExtensions
      • TypeUtility
      • TypeUtilityExtensions
      • UriConverter
      • UriScheme
      • UriSchemeConverter
      • UriUtility
      • Validator
      • VersionUtility
      • VerticalDirection
      • Wrapper
      • Wrapper<T>
      • WrapperExtensions
    • Cuemon.Collections
      • DataPairCollection
      • DataPairDictionary
    • Cuemon.Collections.Generic
      • CollectionExtensions
      • ComparisonUtility
      • ConditionalCollection<T>
      • DictionaryConverter
      • DictionaryConverterExtensions
      • DictionaryExtensions
      • DictionaryUtility
      • DictionaryUtilityExtensions
      • DynamicComparer
      • DynamicEqualityComparer
      • EnumerableConverter
      • EnumerableConverterExtensions
      • EnumerableExtensions
      • EnumerableSizeComparer<T>
      • EnumerableUtility
      • EnumerableUtilityExtensions
      • ISortableTable<TSource>
      • ListExtensions
      • ListUtility
      • ListUtilityExtensions
      • PagedCollection
      • PagedCollection<T>
      • PagedCollectionExtensions
      • PagedSettings
      • PartitionCollection<T>
      • PartitionCollectionExtensions
      • ReferenceComparer<T>
    • Cuemon.Collections.Specialized
      • NameValueCollectionConverter
      • NameValueCollectionConverterExtensions
      • NameValueCollectionUtility
    • Cuemon.Configuration
      • Configurable<TOptions>
      • IConfigurable<TOptions>
    • Cuemon.Data
      • BulkCopyDataReader
      • DataAdapter
      • DataAdapterEventArgs
      • DataAdapterException
      • DataCommand
      • DataConnection
      • DataDependency
      • DataManager
      • DataParameterEqualityComparer
      • DataTransfer
      • DataTransferColumn
      • DataTransferColumnCollection
      • DataTransferExtensions
      • DataTransferRow
      • DataTransferRowCollection
      • DataTransferSorter
      • DataWatcher
      • DbColumn
      • IDataCommand
      • IDataConnection
      • InOperator<T>
      • QueryBuilder
      • QueryFormat
      • QueryInsertAction
      • QueryType
      • QueryUtility
      • StringDataReader
      • UniqueIndexViolationException
    • Cuemon.Data.CsvClient
      • CsvDataReader
    • Cuemon.Data.SqlClient
      • SqlDataManager
      • SqlInOperator<T>
      • SqlQueryBuilder
    • Cuemon.Data.XmlClient
      • XmlDataReader
    • Cuemon.Diagnostics
      • EventLogEntryType
      • ExceptionDescriptor
      • ExceptionDescriptorAttribute
      • FileVersionInfoExtensions
      • Profiler
      • ProfilerOptions
      • TimeMeasure
      • TimeMeasureOptions
      • TimeMeasureProfiler
      • TimeMeasureProfiler<TResult>
    • Cuemon.Globalization
      • IMessageLocalizer
      • RegionInfoExtensions
      • World
    • Cuemon.Integrity
      • CacheValidator
      • CacheValidatorExtensions
      • CacheValidatorOptions
      • ChecksumBuilder
      • ChecksumBuilderExtensions
      • ChecksumBuilderOptions
      • ChecksumMethod
      • ChecksumResult
      • ChecksumStrength
      • ICacheableEntity
      • ICacheableIntegrity
      • ICacheableTimestamp
    • Cuemon.IO
      • FileInfoConverter
      • JsonStreamConverter
      • StreamConverter
      • StreamConverterExtensions
      • StreamExtensions
      • StreamUtility
      • StreamUtilityExtensions
      • StreamWriterOptions
      • StreamWriterUtility
      • TextReaderConverter
      • TextReaderConverterExtensions
    • Cuemon.IO.Compression
      • CompressionType
      • CompressionUtility
      • CompressionUtilityExtensions
    • Cuemon.Messaging
      • DynamicCorrelation
      • DynamicRequest
      • ICorrelation
      • IRequest
    • Cuemon.Net
      • HttpStatusCodeExtensions
      • NetDependency
      • NetWatcher
    • Cuemon.Net.Http
      • HttpManager
      • HttpManagerExtensions
      • HttpManagerOptions
      • HttpMethodConverter
      • HttpMethodExtensions
      • HttpMethods
      • HttpRequestOptions
    • Cuemon.Reflection
      • ActivatorUtility
      • AssemblyUtility
      • AssemblyUtilityExtensions
      • MemberInfoExtensions
      • MethodBaseConverter
      • MethodBaseConverterExtensions
      • MethodDescriptor
      • ObjectHierarchyOptions
      • ParameterSignature
      • ReflectionUtility
      • ReflectionUtilityExtensions
      • ResourceMatch
    • Cuemon.Runtime
      • Dependency
      • DependencyEventArgs
      • IDependency
      • Watcher
      • WatcherEventArgs
    • Cuemon.Runtime.Caching
      • CacheCollection
      • CacheEventArgs
      • CachingManager
    • Cuemon.Runtime.Serialization
      • JsonConverter
      • JsonInstance
      • JsonInstanceCollection
      • JsonWriter
      • XmlJsonInstance
    • Cuemon.Security
      • Obfuscator
      • ObfuscatorMapping
      • SecureXmlObfuscator
      • SecurityToken
      • SecurityTokenSettings
      • SecurityUtility
      • XmlObfuscator
    • Cuemon.Security.Cryptography
      • AdvancedEncryptionStandardKeySize
      • AdvancedEncryptionStandardUtility
      • CyclicRedundancyCheck
      • CyclicRedundancyCheck32
      • HashAlgorithmType
      • HashOptions
      • HashResult
      • HashUtility
      • HashUtilityExtensions
      • HmacAlgorithmType
      • HmacUtility
      • HmacUtilityExtensions
      • KeyedHashOptions
      • PolynomialRepresentation
      • StreamHashOptions
      • StreamKeyedHashOptions
      • StringHashOptions
      • StringKeyedHashOptions
      • StrongNumberUtility
    • Cuemon.Security.Web
      • JsonWebToken
      • JsonWebTokenHashAlgorithm
      • JsonWebTokenHashAlgorithmConverter
      • JsonWebTokenHeader
      • JsonWebTokenPayload
    • Cuemon.Serialization
      • ExceptionDescriptorSerializationOptions
    • Cuemon.Serialization.Formatters
      • Formatter<TFormat>
      • FormatterExtensions
    • Cuemon.Serialization.Xml
      • DynamicXmlConverter
      • DynamicXmlSerializable
      • XmlConvert
      • XmlReaderExtensions
      • XmlSerializer
      • XmlSerializerSettings
      • XmlSerializerSettingsExtensions
      • XmlWriterExtensions
    • Cuemon.Serialization.Xml.Converters
      • DefaultXmlConverter
      • XmlConverter
      • XmlConverterListExtensions
    • Cuemon.Serialization.Xml.Formatters
      • XmlFormatter
      • XmlFormatterOptions
    • Cuemon.Text
      • EncodingConverter
      • EncodingExtensions
      • EncodingOptions
      • EncodingUtility
      • FallbackEncodingOptions
    • Cuemon.Threading
      • AsyncOptions
      • ParallelTasks
      • ThreadPoolUtility
    • Cuemon.Threading.Tasks
      • TaskExtensions
    • Cuemon.Web
      • FieldValueFilter
      • FieldValueSeparator
      • FormConverter
      • FormUtility
      • HeadersConverter
      • HeadersUtility
      • HttpUtility
      • HttpUtilityExtensions
      • QueryStringConverter
      • QueryStringUtility
    • Cuemon.Web.Security
      • WebSecurityUtility
      • WebSecurityUtilityExtensions
    • Cuemon.Xml
      • XmlConvertExtensions
      • XmlCopyOptions
      • XmlDocumentConverter
      • XmlEncodingUtility
      • XmlReaderConverter
      • XmlReaderUtility
      • XmlReaderUtilityExtensions
      • XmlStreamConverter
      • XmlUtility
      • XmlUtilityExtensions
      • XmlWriterUtility
      • XmlWriterUtilityExtensions
    • Cuemon.Xml.Linq
      • XElementExtensions
    • Cuemon.Xml.Serialization
      • SerializableOrder
      • XmlQualifiedEntity
      • XmlWrapper
    • Cuemon.Xml.XPath
      • XPathNavigableConverter

    Class EnumUtility

    This utility class is designed to make enum related operations easier to work with.

    Inheritance
    System.Object
    EnumUtility
    Namespace: Cuemon
    Assembly: Cuemon.Core.dll
    Syntax
    public static class EnumUtility

    Methods

    | Improve this Doc

    HasFlag<TEnum>(TEnum, TEnum)

    Determines whether one or more bit fields are set in the specified source.

    Declaration
    public static bool HasFlag<TEnum>(TEnum source, TEnum value)
        where TEnum : struct, IConvertible
    Parameters
    Type Name Description
    TEnum source

    The bit field or bit fields to test if set in value.

    TEnum value

    An enumeration value.

    Returns
    Type Description
    System.Boolean

    true if the bit field or bit fields that are set in source are also set in the value; otherwise, false.

    Type Parameters
    Name Description
    TEnum

    The type of the enumeration.

    | Improve this Doc

    IsStringOf<TEnum>(String)

    Determines whether the specified value is an equivalent of TEnum.

    Declaration
    public static bool IsStringOf<TEnum>(string value)
        where TEnum : struct, IConvertible
    Parameters
    Type Name Description
    System.String value

    A string containing the name or value to validate.

    Returns
    Type Description
    System.Boolean

    true if the value parameter is an equivalent of TEnum; otherwise, false.

    Type Parameters
    Name Description
    TEnum

    The type of the enumeration to validate.

    | Improve this Doc

    IsStringOf<TEnum>(String, Boolean)

    Determines whether the specified value is an equivalent of TEnum.

    Declaration
    public static bool IsStringOf<TEnum>(string value, bool ignoreCase)
        where TEnum : struct, IConvertible
    Parameters
    Type Name Description
    System.String value

    A string containing the name or value to validate.

    System.Boolean ignoreCase

    true to ignore case; false to regard case.

    Returns
    Type Description
    System.Boolean

    true if the value parameter is an equivalent of TEnum; otherwise, false.

    Type Parameters
    Name Description
    TEnum

    The type of the enumeration to validate.

    | Improve this Doc

    Parse<TEnum>(String)

    Converts the string representation of the name or numeric value of one or more enumerated constants to an equivalent enumerated TEnum.

    Declaration
    public static TEnum Parse<TEnum>(string value)
        where TEnum : struct, IConvertible
    Parameters
    Type Name Description
    System.String value

    A string containing the name or value to convert.

    Returns
    Type Description
    TEnum

    An enum of type TEnum whose value is represented by value.

    Type Parameters
    Name Description
    TEnum

    The type of the enumeration to convert.

    | Improve this Doc

    Parse<TEnum>(String, Boolean)

    Converts the string representation of the name or numeric value of one or more enumerated constants to an equivalent enumerated TEnum.

    Declaration
    public static TEnum Parse<TEnum>(string value, bool ignoreCase)
        where TEnum : struct, IConvertible
    Parameters
    Type Name Description
    System.String value

    A string containing the name or value to convert.

    System.Boolean ignoreCase

    true to ignore case; false to regard case.

    Returns
    Type Description
    TEnum

    An enum of type TEnum whose value is represented by value.

    Type Parameters
    Name Description
    TEnum

    The type of the enumeration to convert.

    Exceptions
    Type Condition
    System.ArgumentNullException

    value is null.

    TypeArgumentException

    TEnum does not represents an enumeration.

    System.ArgumentException

    value does not represents an enumeration.

    | Improve this Doc

    ToEnumerable<TEnum>()

    Creates an System.Collections.Generic.IEnumerable<T> sequence from the specified TEnum.

    Declaration
    public static IEnumerable<KeyValuePair<int, string>> ToEnumerable<TEnum>()
        where TEnum : struct, IConvertible
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.Int32, System.String>>

    An System.Collections.Generic.IEnumerable<T> sequence equivalent to TEnum.

    Type Parameters
    Name Description
    TEnum

    The type of the enumeration.

    | Improve this Doc

    ToEnumerable<T, TEnum>()

    Creates an System.Collections.Generic.IEnumerable<T> sequence from the specified TEnum.

    Declaration
    public static IEnumerable<KeyValuePair<T, string>> ToEnumerable<T, TEnum>()
        where T : struct, IConvertible where TEnum : struct, IConvertible
    Returns
    Type Description
    System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<T, System.String>>

    An System.Collections.Generic.IEnumerable<T> sequence equivalent to TEnum.

    Type Parameters
    Name Description
    T

    The integral type of the enumeration.

    TEnum

    The type of the enumeration.

    | Improve this Doc

    TryParse<TEnum>(String, out TEnum)

    Converts the specified value of the name or numeric value of one or more enumerated constants to an equivalent enumerated object. The return value indicates whether the conversion succeeded.

    Declaration
    public static bool TryParse<TEnum>(string value, out TEnum result)
        where TEnum : struct, IConvertible
    Parameters
    Type Name Description
    System.String value

    A string containing the name or value to convert.

    TEnum result

    When this method returns, result contains an object of type TEnum whose value is represented by value if the parse operation succeeds. If the parse operation fails, result contains the default value of the underlying type of TEnum.

    Returns
    Type Description
    System.Boolean

    true if the value parameter was converted successfully; otherwise, false.

    Type Parameters
    Name Description
    TEnum

    The type of the enumeration to convert.

    | Improve this Doc

    TryParse<TEnum>(String, Boolean, out TEnum)

    Converts the specified value of the name or numeric value of one or more enumerated constants to an equivalent enumerated object. A parameter specifies whether the operation is case-sensitive. The return value indicates whether the conversion succeeded.

    Declaration
    public static bool TryParse<TEnum>(string value, bool ignoreCase, out TEnum result)
        where TEnum : struct, IConvertible
    Parameters
    Type Name Description
    System.String value

    A string containing the name or value to convert.

    System.Boolean ignoreCase

    true to ignore case; false to regard case.

    TEnum result

    When this method returns, result contains an object of type TEnum whose value is represented by value if the parse operation succeeds. If the parse operation fails, result contains the default value of the underlying type of TEnum.

    Returns
    Type Description
    System.Boolean

    true if the value parameter was converted successfully; otherwise, false.

    Type Parameters
    Name Description
    TEnum

    The type of the enumeration to convert.

    • Improve this Doc
    • View Source
    In This Article
    • Methods
      • HasFlag<TEnum>(TEnum, TEnum)
      • IsStringOf<TEnum>(String)
      • IsStringOf<TEnum>(String, Boolean)
      • Parse<TEnum>(String)
      • Parse<TEnum>(String, Boolean)
      • ToEnumerable<TEnum>()
      • ToEnumerable<T, TEnum>()
      • TryParse<TEnum>(String, out TEnum)
      • TryParse<TEnum>(String, Boolean, out TEnum)
    Back to top Copyright 2008-2018 Weubphoria. All rights reserved.
    Generated by DocFX