当前位置: 首页>>代码示例>>C#>>正文


C# IDesignerHost.GetType方法代码示例

本文整理汇总了C#中IDesignerHost.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# IDesignerHost.GetType方法的具体用法?C# IDesignerHost.GetType怎么用?C# IDesignerHost.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IDesignerHost的用法示例。


在下文中一共展示了IDesignerHost.GetType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateComponentsCore

        // 

        protected override IComponent[] CreateComponentsCore(IDesignerHost host)
        {
            Type typeOfComponent = GetType(host, AssemblyName, TypeName, true);

            if (typeOfComponent == null && host != null)
                typeOfComponent = host.GetType(TypeName);

            if (typeOfComponent == null)
            {
                ITypeProviderCreator tpc = null;
                if (host != null)
                    tpc = (ITypeProviderCreator)host.GetService(typeof(ITypeProviderCreator));
                if (tpc != null)
                {
                    System.Reflection.Assembly assembly = tpc.GetTransientAssembly(this.AssemblyName);
                    if (assembly != null)
                        typeOfComponent = assembly.GetType(this.TypeName);
                }

                if (typeOfComponent == null)
                    typeOfComponent = GetType(host, AssemblyName, TypeName, true);
            }

            ArrayList comps = new ArrayList();
            if (typeOfComponent != null)
            {
                if (typeof(IComponent).IsAssignableFrom(typeOfComponent))
                    comps.Add(TypeDescriptor.CreateInstance(null, typeOfComponent, null, null));
            }

            IComponent[] temp = new IComponent[comps.Count];
            comps.CopyTo(temp, 0);
            return temp;
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:36,代码来源:WinOEToolBoxItem.cs

示例2: CreateComponentsCore

 protected override IComponent[] CreateComponentsCore(IDesignerHost host)
 {
     Type c = this.GetType(host, base.AssemblyName, base.TypeName, true);
     if ((c == null) && (host != null))
     {
         c = host.GetType(base.TypeName);
     }
     if (c == null)
     {
         ITypeProviderCreator service = null;
         if (host != null)
         {
             service = (ITypeProviderCreator) host.GetService(typeof(ITypeProviderCreator));
         }
         if (service != null)
         {
             Assembly transientAssembly = service.GetTransientAssembly(base.AssemblyName);
             if (transientAssembly != null)
             {
                 c = transientAssembly.GetType(base.TypeName);
             }
         }
         if (c == null)
         {
             c = this.GetType(host, base.AssemblyName, base.TypeName, true);
         }
     }
     ArrayList list = new ArrayList();
     if ((c != null) && typeof(IComponent).IsAssignableFrom(c))
     {
         list.Add(TypeDescriptor.CreateInstance(null, c, null, null));
     }
     IComponent[] array = new IComponent[list.Count];
     list.CopyTo(array, 0);
     return array;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:36,代码来源:ActivityToolboxItem.cs


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