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


C# IObjectFactory.GetType方法代码示例

本文整理汇总了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);
        }
开发者ID:pampero,项目名称:cgFramework,代码行数:15,代码来源:SpringServiceHost.cs

示例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);
     }
 }
开发者ID:jbunzel,项目名称:MvcRQ_git,代码行数:12,代码来源:ConfigurationLoader.cs

示例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);
            }
        }
开发者ID:Binodesk,项目名称:spring-net,代码行数:21,代码来源:EnterpriseServicesExporter.cs

示例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);
        }
开发者ID:ouyangyl,项目名称:MySpringNet,代码行数:17,代码来源:ServiceProxyTypeBuilder.cs


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