System.ComponentModel.TypeDescriptor.GetConverter C# (CSharp) Method

GetConverter() public static method

Gets a type converter for the specified type.
public static GetConverter ( Type type ) : TypeConverter
type System.Type
return TypeConverter
        public static TypeConverter GetConverter(Type type)
        {
            TypeConverter converter = GetDescriptor(type, "type").GetConverter();
            return converter;
        }

Same methods

TypeDescriptor::GetConverter ( object component ) : TypeConverter
TypeDescriptor::GetConverter ( object component, bool noCustomTypeDesc ) : TypeConverter

Usage Example

Beispiel #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NameableConverter"/> class.
 /// </summary>
 /// <param name="type">The type.</param>
 /// <exception cref="System.ArgumentException">NameableConverterBadCtorArg - type</exception>
 public NameableConverter(Type type)
 {
     NameableType            = type;
     UnderlyingType          = Nameable.GetUnderlyingType(type) ?? throw new ArgumentException(nameof(type), "type");
     UnderlyingTypeConverter = TypeDescriptor.GetConverter(UnderlyingType);
 }
All Usage Examples Of System.ComponentModel.TypeDescriptor::GetConverter