本文整理汇总了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;
}
示例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;
}