• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# ComponentModel.TypeDescriptionProvider类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.ComponentModel.TypeDescriptionProvider的典型用法代码示例。如果您正苦于以下问题:C# TypeDescriptionProvider类的具体用法?C# TypeDescriptionProvider怎么用?C# TypeDescriptionProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TypeDescriptionProvider类属于System.ComponentModel命名空间,在下文中一共展示了TypeDescriptionProvider类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: DefaultTypeDescriptor

		public DefaultTypeDescriptor (TypeDescriptionProvider owner, Type objectType, object instance)
		{
			this.owner = owner;
			this.objectType = objectType;
			this.instance = instance;
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:6,代码来源:TypeDescriptor.cs


示例17: RemoveProvider

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

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

            // Walk the nodes until we find the right one, and then remove it.
            NodeRemove(type, provider);
            RaiseRefresh(type);
        }
开发者ID:ChuangYang,项目名称:corefx,代码行数:16,代码来源:TypeDescriptor.cs


示例18: AddProvider

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

		lock (componentDescriptionProvidersLock) {
			LinkedList <TypeDescriptionProvider> plist;
			WeakObjectWrapper instanceWrapper = new WeakObjectWrapper (instance);
			
			if (!componentDescriptionProviders.TryGetValue (instanceWrapper, out plist)) {
				plist = new LinkedList <TypeDescriptionProvider> ();
				componentDescriptionProviders.Add (new WeakObjectWrapper (instance), plist);
			}

			plist.AddLast (provider);
			instanceWrapper = null;
			Refresh (instance);
		}
	}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:21,代码来源:TypeDescriptor.cs


示例19: NodeRemove

        /// <devdoc>
        ///     Simple linked list code to remove an element
        ///     from the list.  Returns the new head to the
        ///     list.  If the head points to an instance of
        ///     DelegatingTypeDescriptionProvider, we clear the
        ///     node because all it is doing is delegating elsewhere.
        ///
        ///     Note that this behaves a little differently from normal
        ///     linked list code.  In a normal linked list, you remove 
        ///     then target node and fixup the links.  In this linked
        ///     list, we remove the node AFTER the target node, fixup
        ///     the links, and fixup the underlying providers that each
        ///     node references.  The reason for this is that most
        ///     providers keep a reference to the previous provider,
        ///     which is exposed as one of these nodes.  Therefore,
        ///     to remove a provider the node following is most likely
        ///     referenced by that provider
        /// </devdoc>
        private static void NodeRemove(object key, TypeDescriptionProvider provider)
        {
            lock(_providerTable)
            {
                TypeDescriptionNode head = (TypeDescriptionNode)_providerTable[key];
                TypeDescriptionNode target = head;
                TypeDescriptionNode prev = null;

                while(target != null && target.Provider != provider)
                {
                    prev = target;
                    target = target.Next;
                }

                if (target != null)
                {
                    // We have our target node.  There are three cases
                    // to consider:  the target is in the middle, the head,
                    // or the end.

                    if (target.Next != null) {
                        // If there is a node after the target node,
                        // steal the node's provider and store it
                        // at the target location.  This removes
                        // the provider at the target location without
                        // the need to modify providers which may be
                        // pointing to "target".  
                        target.Provider = target.Next.Provider;

                        // Now remove target.Next from the list
                        target.Next = target.Next.Next;

                        // If the new provider we got is a delegating
                        // provider, we can remove this node from 
                        // the list.  The delegating provider should
                        // always be at the end of the node list.
                        if (target == head && target.Provider is DelegatingTypeDescriptionProvider) {
                            Debug.Assert(target.Next == null, "Delegating provider should always be the last provider in the chain.");
                            _providerTable.Remove(key);
                        }
                    }
                    else if (target != head) {
                        // If target is the last node, we can't
                        // assign a new provider over to it.  What
                        // we can do, however, is assign a delegating
                        // provider into the target node.  This routes
                        // requests from the previous provider into
                        // the next base type provider list.

                        // We don't do this if the target is the head.
                        // In that case, we can remove the node
                        // altogether since no one is pointing to it.
                        
                        Type keyType = key as Type;
                        if (keyType == null) keyType = key.GetType();
                        
                        target.Provider = new DelegatingTypeDescriptionProvider(keyType.BaseType);
                    }
                    else {
                        _providerTable.Remove(key);
                    }

                    // Finally, clear our cache of provider types; it might be invalid 
                    // now.
                    _providerTypeTable.Clear();
                }
            }
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:86,代码来源:TypeDescriptor.cs


示例20: AddProviderTransparent

	public static void AddProviderTransparent (TypeDescriptionProvider provider, Type type)
	{
		AddProvider (provider, type);
	}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:4,代码来源:TypeDescriptor.cs



注:本文中的System.ComponentModel.TypeDescriptionProvider类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ComponentModel.Win32Exception类代码示例发布时间:2022-05-26
下一篇:
C# CodeDom.CodeEventReferenceExpression类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap