當前位置: 首頁>>代碼示例>>C#>>正文


C# TypeConverter.GetType方法代碼示例

本文整理匯總了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);
        }
開發者ID:abc-software,項目名稱:abc.xacml,代碼行數:7,代碼來源:TypeConverterWrapper.cs

示例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 );
			}
		}
開發者ID:amithasan,項目名稱:Framework-Class-Library-Extension,代碼行數:14,代碼來源:RedirectTypeConverter.cs

示例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
 }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:8,代碼來源:TypeDescriptor.cs

示例4: GetIfConverterCanConvert

 private bool GetIfConverterCanConvert(TypeConverter converter)
 {
     string converterTypeName = converter.GetType().Name;
     if (converterTypeName == "MatrixConverter" ||
         converterTypeName == "CollectionConverter"
         )
     {
         return false;
     }
     return true;
 }
開發者ID:jiailiuyan,項目名稱:Gum,代碼行數:11,代碼來源:TextBoxDisplayLogic.cs

示例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);
     }
 }
開發者ID:shankithegreat,項目名稱:commanderdotnet,代碼行數:92,代碼來源:XmlSerializationWriter1.cs


注:本文中的System.ComponentModel.TypeConverter.GetType方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。