GetConverter() public static method

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