当前位置: 首页>>代码示例>>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;未经允许,请勿转载。