GetConverter() public static method

Gets a type converter for the specified type.
public static GetConverter ( Type type ) : TypeConverter
type System.Type
return TypeConverter
Ejemplo n.º 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);
 }
Ejemplo n.º 2
0
 public override string ToString()
 {
     return(TypeDescriptor.GetConverter(typeof(System.ComponentModel.InheritanceLevel)).ConvertToString(this.InheritanceLevel));
 }
Ejemplo n.º 3
0
 public TypeConverter GetConverter() => NativeTypeDesc.GetConverter(_entityType, true);