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


C# ComponentModel.TypeDescriptionProvider類代碼示例

本文整理匯總了C#中System.ComponentModel.TypeDescriptionProvider的典型用法代碼示例。如果您正苦於以下問題:C# TypeDescriptionProvider類的具體用法?C# TypeDescriptionProvider怎麽用?C# TypeDescriptionProvider使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


TypeDescriptionProvider類屬於System.ComponentModel命名空間,在下文中一共展示了TypeDescriptionProvider類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ClientBuildManager

 public ClientBuildManager(string appVirtualDir, string appPhysicalSourceDir, string appPhysicalTargetDir, ClientBuildManagerParameter parameter, TypeDescriptionProvider typeDescriptionProvider)
 {
     this._lock = new object();
     if (parameter == null)
     {
         parameter = new ClientBuildManagerParameter();
     }
     this.InitializeCBMTDPBridge(typeDescriptionProvider);
     if (!string.IsNullOrEmpty(appPhysicalTargetDir))
     {
         parameter.PrecompilationFlags |= PrecompilationFlags.Clean;
     }
     this._hostingParameters = new HostingEnvironmentParameters();
     this._hostingParameters.HostingFlags = HostingEnvironmentFlags.ClientBuildManager | HostingEnvironmentFlags.DontCallAppInitialize;
     this._hostingParameters.ClientBuildManagerParameter = parameter;
     this._hostingParameters.PrecompilationTargetPhysicalDirectory = appPhysicalTargetDir;
     if (typeDescriptionProvider != null)
     {
         this._hostingParameters.HostingFlags |= HostingEnvironmentFlags.SupportsMultiTargeting;
     }
     if (appVirtualDir[0] != '/')
     {
         appVirtualDir = "/" + appVirtualDir;
     }
     if (((appPhysicalSourceDir == null) && appVirtualDir.StartsWith("/IISExpress/", StringComparison.OrdinalIgnoreCase)) && (appVirtualDir.Length > "/IISExpress/".Length))
     {
         int index = appVirtualDir.IndexOf('/', "/IISExpress/".Length);
         if (index > 0)
         {
             this._hostingParameters.IISExpressVersion = appVirtualDir.Substring("/IISExpress/".Length, index - "/IISExpress/".Length);
             appVirtualDir = appVirtualDir.Substring(index);
         }
     }
     this.Initialize(VirtualPath.CreateNonRelative(appVirtualDir), appPhysicalSourceDir);
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:35,代碼來源:ClientBuildManager.cs

示例2: AddProvider

 public static void AddProvider(TypeDescriptionProvider provider, object instance)
 {
     bool flag;
     if (provider == null)
     {
         throw new ArgumentNullException("provider");
     }
     if (instance == null)
     {
         throw new ArgumentNullException("instance");
     }
     lock (_providerTable)
     {
         flag = _providerTable.ContainsKey(instance);
         TypeDescriptionNode node = NodeFor(instance, true);
         TypeDescriptionNode node2 = new TypeDescriptionNode(provider) {
             Next = node
         };
         _providerTable.SetWeak(instance, node2);
         _providerTypeTable.Clear();
     }
     if (flag)
     {
         Refresh(instance, false);
     }
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:26,代碼來源:TypeDescriptor.cs

示例3: DescriptorBase

 /// <summary>
 /// Initializes a new instance of the <see cref="T:DescriptorBase"/> class.
 /// </summary>
 /// <param name="provider">The provider.</param>
 /// <param name="objectType">Type of the object.</param>
 public DescriptorBase(TypeDescriptionProvider provider, Type objectType)
     : base()
 {
     this.provider = provider;
     this.type = objectType;
     mProperties = new PropertyDescriptorCollection(null);
 }
開發者ID:JackWangCUMT,項目名稱:mathnet-yttrium,代碼行數:12,代碼來源:DescriptorBase.cs

示例4: DummyValueInsteadOfNullTypeDescriptionProvider

		/// <summary>
		/// Initializes a new instance of <see cref="DummyValueInsteadOfNullTypeDescriptionProvider"/>.
		/// </summary>
		public DummyValueInsteadOfNullTypeDescriptionProvider(TypeDescriptionProvider existingProvider,
		                                                      string propertyName, object dummyValue)
			: base(existingProvider)
		{
			this._propertyName = propertyName;
			this._dummyValue = dummyValue;
		}
開發者ID:modulexcite,項目名稱:WpfDesigner,代碼行數:10,代碼來源:DummyValueInsteadOfNullTypeDescriptionProvider.cs

示例5: ChooseMethodByType

 private static MethodInfo ChooseMethodByType(TypeDescriptionProvider provider, List<MethodInfo> methods, ICollection values)
 {
     MethodInfo info = null;
     Type c = null;
     foreach (object obj2 in values)
     {
         Type reflectionType = provider.GetReflectionType(obj2);
         MethodInfo info2 = null;
         Type type3 = null;
         if ((info == null) || ((c != null) && !c.IsAssignableFrom(reflectionType)))
         {
             foreach (MethodInfo info3 in methods)
             {
                 ParameterInfo info4 = info3.GetParameters()[0];
                 if (info4 != null)
                 {
                     Type type4 = info4.ParameterType.IsArray ? info4.ParameterType.GetElementType() : info4.ParameterType;
                     if ((type4 != null) && type4.IsAssignableFrom(reflectionType))
                     {
                         if (info != null)
                         {
                             if (!type4.IsAssignableFrom(c))
                             {
                                 continue;
                             }
                             info = info3;
                             c = type4;
                             break;
                         }
                         if (info2 == null)
                         {
                             info2 = info3;
                             type3 = type4;
                         }
                         else
                         {
                             bool flag = type3.IsAssignableFrom(type4);
                             info2 = flag ? info3 : info2;
                             type3 = flag ? type4 : type3;
                         }
                     }
                 }
             }
         }
         if (info == null)
         {
             info = info2;
             c = type3;
         }
     }
     return info;
 }
開發者ID:pritesh-mandowara-sp,項目名稱:DecompliedDotNetLibraries,代碼行數:52,代碼來源:CollectionCodeDomSerializer.cs

示例6: ParameterEditorUserControl

 internal ParameterEditorUserControl(IServiceProvider serviceProvider, System.Web.UI.Control control, System.ComponentModel.TypeDescriptionProvider provider)
 {
     this._serviceProvider = serviceProvider;
     this._control = control;
     this._provider = provider;
     this.InitializeComponent();
     this.InitializeUI();
     this.InitializeParameterEditors();
     this._parameterTypes = this.CreateParameterList();
     foreach (DictionaryEntry entry in this._parameterTypes)
     {
         this._parameterTypeComboBox.Items.Add(entry.Value);
     }
     this._parameterTypeComboBox.InvalidateDropDownWidth();
     this.UpdateUI(false);
 }
開發者ID:Reegenerator,項目名稱:Sample-CustomizeDatasetCS,代碼行數:16,代碼來源:ParameterEditorUserControl.cs

示例7: GetTypeDescriptorShouldReturnExpectedValue

        public void GetTypeDescriptorShouldReturnExpectedValue()
        {
            // arrange
            Func<ICustomTypeDescriptor, ICustomTypeDescriptor> factory = parent =>
            {
                var descriptor = new CustomTypeDescriptor<string>( parent );
                descriptor.AddExtensionProperty( "Name", s => s.GetType().Name );
                return descriptor;
            };
            var target = new TypeDescriptionProvider<string>( factory );

            // act
            var actual = target.GetTypeDescriptor( typeof( string ), "" );
            
            // assert
            Assert.NotNull( actual );
            Assert.IsType( typeof( CustomTypeDescriptor<string> ), actual );
        }
開發者ID:WaffleSquirrel,項目名稱:More,代碼行數:18,代碼來源:TypeDescriptionProviderTTest.cs

示例8: TypeDescriptionNode

 /// <devdoc>
 ///     Creates a new type description node.
 /// </devdoc>
 internal TypeDescriptionNode(TypeDescriptionProvider provider)
 {
     Provider = provider;
 }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:7,代碼來源:TypeDescriptor.cs

示例9: RemoveProvider

        public static void RemoveProvider(TypeDescriptionProvider provider, object instance)
        {
            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }

            if (instance == null)
            {
                throw new ArgumentNullException("instance");
            }

            // Walk the nodes until we find the right one, and then remove it.
            NodeRemove(instance, provider);
            RaiseRefresh(instance);
        }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:16,代碼來源:TypeDescriptor.cs

示例10: AddProvider

        public static void AddProvider(TypeDescriptionProvider provider, Type type)
        {
            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }

            if (type == null)
            {
                throw new ArgumentNullException("type");
            }

            lock(_providerTable)
            {
                // Get the root node, hook it up, and stuff it back into
                // the provider cache.
                TypeDescriptionNode node = NodeFor(type, true);
                TypeDescriptionNode head = new TypeDescriptionNode(provider);
                head.Next = node;
                _providerTable[type] = head;
                _providerTypeTable.Clear();
            }

            Refresh(type);
        }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:25,代碼來源:TypeDescriptor.cs

示例11: ReadonlyTypeDescriptonProvider

 internal ReadonlyTypeDescriptonProvider(TypeDescriptionProvider realProvider)
     : base(realProvider)
 {
 }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:4,代碼來源:PropertyDescriptors.cs

示例12: AddProviderTransparent

        public static void AddProviderTransparent(TypeDescriptionProvider provider, Type type)
        {
            if (provider == null)
            {
                throw new ArgumentNullException(nameof(provider));
            }

            if (type == null)
            {
                throw new ArgumentNullException(nameof(type));
            }

            AddProvider(provider, type);
        }
開發者ID:ChuangYang,項目名稱:corefx,代碼行數:14,代碼來源:TypeDescriptor.cs

示例13: TypeDescriptionProvider

		protected TypeDescriptionProvider (TypeDescriptionProvider parent)
		{
			_parent = parent;
		}
開發者ID:stabbylambda,項目名稱:mono,代碼行數:4,代碼來源:TypeDescriptionProvider.cs

示例14: RemoveProviderTransparent

	public static void RemoveProviderTransparent (TypeDescriptionProvider provider, Type type)
	{
		RemoveProvider (provider, type);
	}
開發者ID:calumjiao,項目名稱:Mono-Class-Libraries,代碼行數:4,代碼來源:TypeDescriptor.cs

示例15: RemoveProvider

	static void RemoveProvider (TypeDescriptionProvider provider, LinkedList <TypeDescriptionProvider> plist)
	{
		LinkedListNode <TypeDescriptionProvider> node = plist.Last;
		LinkedListNode <TypeDescriptionProvider> first = plist.First;
		TypeDescriptionProvider p;
				
		do {
			p = node.Value;
			if (p == provider) {
				plist.Remove (node);
				break;
			}
			if (node == first)
				break;
					
			node = node.Previous;
					
		} while (true);
	}
開發者ID:calumjiao,項目名稱:Mono-Class-Libraries,代碼行數:19,代碼來源:TypeDescriptor.cs


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