KGy SOFT

FlagsEnumConverter Class

KGy SOFT Core Libraries Help
By extending the EnumConverter, this class provides a type converter for flags Enum instances (not necessarily but typically marked by FlagsAttribute) by providing Boolean properties for each flags in the specific Enum type.
Inheritance Hierarchy

SystemObject
  System.ComponentModelTypeConverter
    System.ComponentModelEnumConverter
      KGySoft.ComponentModelFlagsEnumConverter

Namespace:  KGySoft.ComponentModel
Assembly:  KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 5.3.0
Syntax

public class FlagsEnumConverter : EnumConverter

The FlagsEnumConverter type exposes the following members.

Constructors

  NameDescription
Public methodFlagsEnumConverter
Creates an instance of the FlagsEnumConverter class.
Top
Methods

  NameDescription
Public methodGetProperties
Retrieves the property descriptors for the enumeration fields. These property descriptors will be used by the property grid to show separate enumeration fields.
(Overrides TypeConverterGetProperties(ITypeDescriptorContext, Object, Attribute).)
Public methodGetPropertiesSupported
Returns whether this object supports properties, using the specified context.
(Overrides TypeConverterGetPropertiesSupported(ITypeDescriptorContext).)
Public methodGetStandardValuesSupported
Gets whether this object supports a standard set of values that can be picked from a list using the specified context.
(Overrides EnumConverterGetStandardValuesSupported(ITypeDescriptorContext).)
Top
Extension Methods

  NameDescription
Public Extension MethodConvert(Type, CultureInfo)Overloaded.
Converts an Object specified in the obj parameter to the desired targetType.
See the Examples section of the generic ConvertTTarget(Object, CultureInfo) overload for an example.
(Defined by ObjectExtensions.)
Public Extension MethodCode exampleConvertTTarget(CultureInfo)Overloaded.
Converts an Object specified in the obj parameter to the desired TTarget.
(Defined by ObjectExtensions.)
Public Extension MethodIn (Defined by ObjectExtensions.)
Public Extension MethodTryConvert(Type, Object)Overloaded.
Tries to convert an Object specified in the obj parameter to the desired targetType.
(Defined by ObjectExtensions.)
Public Extension MethodTryConvert(Type, CultureInfo, Object)Overloaded.
Tries to convert an Object specified in the obj parameter to the desired targetType.
(Defined by ObjectExtensions.)
Public Extension MethodTryConvertTTarget(TTarget)Overloaded.
Tries to convert an Object specified in the obj parameter to the desired TTarget.
See the Examples section of the ConvertTTarget(Object, CultureInfo) method for a related example.
(Defined by ObjectExtensions.)
Public Extension MethodTryConvertTTarget(CultureInfo, TTarget)Overloaded.
Tries to convert an Object specified in the obj parameter to the desired TTarget.
See the Examples section of the ConvertTTarget(Object, CultureInfo) method for a related example.
(Defined by ObjectExtensions.)
Top
See Also

Reference