本文整理匯總了C#中System.ComponentModel.TypeConverter.GetType方法的典型用法代碼示例。如果您正苦於以下問題:C# TypeConverter.GetType方法的具體用法?C# TypeConverter.GetType怎麽用?C# TypeConverter.GetType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.ComponentModel.TypeConverter
的用法示例。
在下文中一共展示了TypeConverter.GetType方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: IsForType
public bool IsForType(TypeConverter converter) {
Contract.Requires<ArgumentNullException>(converter != null);
Type currentConverterType = this.typeConverter.GetType();
Type paramConverterType = converter.GetType();
return paramConverterType.IsAssignableFrom(currentConverterType);
}
示例2: InitializeConverter
public void InitializeConverter()
{
if ( _converter != null )
{
return;
}
_converter = TypeDescriptor.GetConverter( _type );
if ( _converter.GetType() == GetType() )
{
string message = string.Format( "Conversion failed. Converter for {0} is missing in TypeDescriptor.", _type );
throw new InvalidOperationException( message );
}
}
示例3: DebugValidate
private static void DebugValidate(TypeConverter converter, object instance, bool noCustomTypeDesc)
{
#if DEBUG
if (!DebugShouldValidate(instance)) return;
TypeConverter debugConverter = DebugTypeDescriptor.GetConverter(instance, noCustomTypeDesc);
Debug.Assert(debugConverter.GetType() == converter.GetType(), "TypeDescriptor engine Validation Failure.");
#endif
}
示例4: GetIfConverterCanConvert
private bool GetIfConverterCanConvert(TypeConverter converter)
{
string converterTypeName = converter.GetType().Name;
if (converterTypeName == "MatrixConverter" ||
converterTypeName == "CollectionConverter"
)
{
return false;
}
return true;
}
示例5: Write4_TypeConverter
private void Write4_TypeConverter(string n, string ns, TypeConverter o, bool isNullable, bool needType)
{
if (o == null)
{
if (isNullable)
{
base.WriteNullTagLiteral(n, ns);
}
}
else
{
if (!needType)
{
System.Type type = o.GetType();
if (type != typeof(TypeConverter))
{
if (type == typeof(EncodingConveter))
{
this.Write132_EncodingConveter(n, ns, (EncodingConveter) o, isNullable, true);
return;
}
if (type == typeof(AudioChannelsTypeConverter))
{
this.Write125_AudioChannelsTypeConverter(n, ns, (AudioChannelsTypeConverter) o, isNullable, true);
return;
}
if (type == typeof(PropertyTypeConverter))
{
this.Write123_PropertyTypeConverter(n, ns, (PropertyTypeConverter) o, isNullable, true);
return;
}
if (type == typeof(RatingTypeConverter))
{
this.Write131_RatingTypeConverter(n, ns, (RatingTypeConverter) o, isNullable, true);
return;
}
if (type == typeof(ISOSpeedTypeConverter))
{
this.Write130_ISOSpeedTypeConverter(n, ns, (ISOSpeedTypeConverter) o, isNullable, true);
return;
}
if (type == typeof(DPITypeConverter))
{
this.Write129_DPITypeConverter(n, ns, (DPITypeConverter) o, isNullable, true);
return;
}
if (type == typeof(ImageSizeTypeConverter))
{
this.Write128_ImageSizeTypeConverter(n, ns, (ImageSizeTypeConverter) o, isNullable, true);
return;
}
if (type == typeof(DurationTypeConverter))
{
this.Write127_DurationTypeConverter(n, ns, (DurationTypeConverter) o, isNullable, true);
return;
}
if (type == typeof(AudioSampleRateTypeConverter))
{
this.Write126_AudioSampleRateTypeConverter(n, ns, (AudioSampleRateTypeConverter) o, isNullable, true);
return;
}
if (type == typeof(BitrateTypeConverter))
{
this.Write124_BitrateTypeConverter(n, ns, (BitrateTypeConverter) o, isNullable, true);
return;
}
if (type == typeof(ArchiveFormatConverter))
{
this.Write35_ArchiveFormatConverter(n, ns, (ArchiveFormatConverter) o, isNullable, true);
return;
}
if (type == typeof(KeysConverter))
{
this.Write5_KeysConverter(n, ns, (KeysConverter) o, isNullable, true);
return;
}
if (type != typeof(KeysConverter2))
{
throw base.CreateUnknownTypeException(o);
}
this.Write6_KeysConverter2(n, ns, (KeysConverter2) o, isNullable, true);
return;
}
}
base.WriteStartElement(n, ns, o, false, null);
if (needType)
{
base.WriteXsiType("TypeConverter", "");
}
base.WriteEndElement(o);
}
}