本文整理汇总了C#中IObjectFactory.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# IObjectFactory.GetType方法的具体用法?C# IObjectFactory.GetType怎么用?C# IObjectFactory.GetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IObjectFactory
的用法示例。
在下文中一共展示了IObjectFactory.GetType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateServiceType
private static Type CreateServiceType(string serviceName, IObjectFactory objectFactory, bool useServiceProxyTypeCache)
{
if (StringUtils.IsNullOrEmpty(serviceName))
{
throw new ArgumentException("The service name cannot be null or an empty string.", "serviceName");
}
if (objectFactory.IsTypeMatch(serviceName, typeof(Type)))
{
return objectFactory.GetObject(serviceName) as Type;
}
return new ServiceProxyTypeBuilder(serviceName, objectFactory.GetType(serviceName), useServiceProxyTypeCache)
.BuildProxyType(objectFactory);
}
示例2: AddObjectFactory
/// <summary>
/// Registers an Object Factory with the Configuration Loader
/// </summary>
/// <param name="factory">Object Factory</param>
public static void AddObjectFactory(IObjectFactory factory)
{
Type loaderType = factory.GetType();
if (!_factories.Any(l => l.GetType().Equals(loaderType)))
{
_factories.Add(factory);
}
}
示例3: GenerateComponentTypes
/// <summary>
/// Generates service types from the <paramref name="components"/> list of <see cref="ServicedComponentExporter"/> instances
/// into the given assembly.
/// </summary>
/// <param name="module">the module to export types to</param>
/// <param name="objectFactory">the object factory to resolve target types</param>
/// <param name="components">the list of <see cref="ServicedComponentExporter"/> instances.</param>
/// <param name="springManaged">whether to generate context lookups, <see cref="ServicedComponentExporter.CreateWrapperType"/></param>
private static void GenerateComponentTypes(ModuleBuilder module, IObjectFactory objectFactory, IList components, bool springManaged)
{
Type baseType = typeof(ServicedComponent);
if (springManaged)
{
baseType = CreateSpringServicedComponentType(module, baseType);
}
foreach (ServicedComponentExporter definition in components)
{
definition.CreateWrapperType(module, baseType, objectFactory.GetType(definition.TargetName), springManaged);
}
}
示例4: ServiceProxyTypeBuilder
/// <summary>
/// Creates a new instance of the
/// <see cref="Spring.ServiceModel.Support.ServiceProxyTypeBuilder"/> class.
/// </summary>
/// <param name="targetName">The name of the service within Spring's IoC container.</param>
/// <param name="serviceTypeName">The name of the generated WCF service <see cref="System.Type"/>.</param>
/// <param name="objectFactory">The <see cref="IObjectFactory"/> to use.</param>
/// <param name="useServiceProxyTypeCache">Whether to cache the generated service proxy type.</param>
public ServiceProxyTypeBuilder(string targetName, string serviceTypeName, IObjectFactory objectFactory, bool useServiceProxyTypeCache)
{
this.targetName = targetName;
this.objectFactory = objectFactory;
this.useServiceProxyTypeCache = useServiceProxyTypeCache;
this.Name = serviceTypeName;
this.TargetType = objectFactory.GetType(targetName);
}