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


C# IConversionManager类代码示例

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


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

示例1: RelativePathSubDependencyResolver

 /// <summary>
 ///   Constructor
 /// </summary>
 public RelativePathSubDependencyResolver(IKernel kernel)
 {
     m_converter = (IConversionManager)kernel.GetSubSystem(SubSystemConstants.ConversionManagerKey);
       SettingsSubSystem settingsSubSystem = kernel.GetSettingsSubSystem();
       settingsSubSystem.ResolveRelativePaths = true;
       VALUES = new Dictionary<string, object>();
 }
开发者ID:monemihir,项目名称:castle-windsor-extensions,代码行数:10,代码来源:RelativePathSubDependencyResolver.cs

示例2: SetUpComponents

        protected virtual void SetUpComponents(IConfiguration[] configurations, IWindsorContainer container, IConversionManager converter)
        {
            foreach (var component in configurations)
            {
                var implementation = GetType(converter, component.Attributes["type"]);
                var firstService = GetType(converter, component.Attributes["service"]);
                var services = new HashSet<Type>();
                if (firstService != null)
                {
                    services.Add(firstService);
                }
                CollectAdditionalServices(component, converter, services);

                var name = default(string);
                if (implementation != null)
                {
                    AssertImplementsService(component, firstService, implementation);
                    var defaults = CastleComponentAttribute.GetDefaultsFor(implementation);
                    if (defaults.ServicesSpecifiedExplicitly && services.Count == 0)
                    {
                        defaults.Services.ForEach(s => services.Add(s));
                    }
                    name = GetName(defaults, component);
                }

                if (services.Count == 0 && implementation == null)
                {
                    continue;
                }

                container.Register(Component.For(services).ImplementedBy(implementation).Named(name));
            }
        }
开发者ID:janv8000,项目名称:Windsor,代码行数:33,代码来源:DefaultComponentInstaller.cs

示例3: ProcessModel

		/// <summary>
		/// Adds the properties as optional dependencies of this component.
		/// </summary>
		/// <param name="kernel"></param>
		/// <param name="model"></param>
		public virtual void ProcessModel(IKernel kernel, ComponentModel model)
		{
			if (converter == null)
			{
				converter = (IConversionManager) 
					kernel.GetSubSystem( SubSystemConstants.ConversionManagerKey );
			}

			InspectProperties(model);
		}
开发者ID:7digital,项目名称:Castle.Windsor,代码行数:15,代码来源:PropertiesDependenciesModelInspector.cs

示例4: SetUpInstallers

		protected virtual void SetUpInstallers(IConfiguration[] installers, IWindsorContainer container, IConversionManager converter)
		{
			var instances = new Dictionary<Type, IWindsorInstaller>();
			foreach (var installer in installers)
			{
				AddInstaller(installer, instances, converter);
			}

			if (instances.Count != 0)
			{
				container.Install(instances.Values.ToArray());
			}
		}
开发者ID:AGiorgetti,项目名称:Castle.InversionOfControl,代码行数:13,代码来源:DefaultComponentInstaller.cs

示例5: AddInstaller

		private void AddInstaller(IConfiguration installer, Dictionary<Type, IWindsorInstaller> cache,
		                          IConversionManager conversionManager, ICollection<Assembly> assemblies)
		{
			var typeName = installer.Attributes["type"];
			if (string.IsNullOrEmpty(typeName) == false)
			{
				var type = conversionManager.PerformConversion<Type>(typeName);
				AddInstaller(cache, type);
				return;
			}

			assemblyName = installer.Attributes["assembly"];
			if (string.IsNullOrEmpty(assemblyName) == false)
			{
				var assembly = ReflectionUtil.GetAssemblyNamed(assemblyName);
				if (assemblies.Contains(assembly))
				{
					return;
				}
				assemblies.Add(assembly);

				GetAssemblyInstallers(cache, assembly);
				return;
			}

#if !SILVERLIGHT
			var directory = installer.Attributes["directory"];
			var mask = installer.Attributes["fileMask"];
			var token = installer.Attributes["publicKeyToken"];
			Debug.Assert(directory != null, "directory != null");
			var assemblyFilter = new AssemblyFilter(directory, mask);
			if (token != null)
			{
				assemblyFilter.WithKeyToken(token);
			}

			foreach (var assembly in ReflectionUtil.GetAssemblies(assemblyFilter))
			{
				if (assemblies.Contains(assembly))
				{
					continue;
				}
				assemblies.Add(assembly);
				GetAssemblyInstallers(cache, assembly);
			}
#endif
		}
开发者ID:RookieX,项目名称:Windsor,代码行数:47,代码来源:DefaultComponentInstaller.cs

示例6: ProcessModel

            public virtual void ProcessModel(IKernel kernel, ComponentModel model)
            {
                if (converter == null) {
                    converter = (IConversionManager) kernel.GetSubSystem(SubSystemConstants.ConversionManagerKey);
                }

                var targetType = model.Implementation;

                var constructors = targetType.GetConstructors(BindingFlags.Public | BindingFlags.Instance);

                foreach (var constructor in constructors) {
                    // We register each public constructor
                    // and let the ComponentFactory select an
                    // eligible amongst the candidates later
                    model.Constructors.Add(CreateConstructorCandidate(model, constructor));
                }
            }
开发者ID:ruanzx,项目名称:mausch,代码行数:17,代码来源:AttributeServiceOverride.cs

示例7: AddInstaller

		private void AddInstaller(IConfiguration installer, Dictionary<Type, IWindsorInstaller> cache, IConversionManager conversionManager)
		{
			var typeName = installer.Attributes["type"];
			if (string.IsNullOrEmpty(typeName) == false)
			{
				var type = conversionManager.PerformConversion(typeName, typeof(Type)) as Type;
				AddInstaller(cache, type);
				return;
			}

			Debug.Assert(string.IsNullOrEmpty(installer.Attributes["assembly"]) == false);
			var types = Assembly.Load(installer.Attributes["assembly"]).GetExportedTypes();
			foreach (var type in InstallerTypes(types))
			{
				AddInstaller(cache, type);
			}
		}
开发者ID:AGiorgetti,项目名称:Castle.InversionOfControl,代码行数:17,代码来源:DefaultComponentInstaller.cs

示例8: SetUpInstallers

		protected virtual void SetUpInstallers(IConfiguration[] installers, IWindsorContainer container,
		                                       IConversionManager converter)
		{
			var instances = new Dictionary<Type, IWindsorInstaller>();
			ICollection<Assembly> assemblies =
#if SL3
				new List<Assembly>();
#else
				new HashSet<Assembly>();
#endif
			foreach (var installer in installers)
			{
				AddInstaller(installer, instances, converter, assemblies);
			}

			if (instances.Count != 0)
			{
				container.Install(instances.Values.ToArray());
			}
		}
开发者ID:thefringeninja,项目名称:Castle.Windsor,代码行数:20,代码来源:DefaultComponentInstaller.cs

示例9: DeserializeComponents

		private static void DeserializeComponents(XmlNodeList nodes, IConfigurationStore store, IConversionManager converter)
		{
			foreach(XmlNode node in nodes)
			{
				if (node.NodeType != XmlNodeType.Element) continue;

				AssertNodeName(node, ComponentNodeName);
				DeserializeComponent(node, store, converter);
			}
		}
开发者ID:Orvid,项目名称:NAntUniversalTasks,代码行数:10,代码来源:XmlInterpreter.cs

示例10: GetType

		private Type GetType(IConversionManager converter, string typeName)
		{
			if (typeName == null)
			{
				return null;
			}
			return converter.PerformConversion<Type>(typeName);
		}
开发者ID:jmuralimohanbabu,项目名称:Castle.Windsor,代码行数:8,代码来源:DefaultComponentInstaller.cs

示例11: CollectAdditionalServices

		private void CollectAdditionalServices(IConfiguration component, IConversionManager converter, ICollection<Type> services)
		{
			var forwardedTypes = component.Children["forwardedTypes"];
			if (forwardedTypes == null)
			{
				return;
			}

			foreach (var forwardedType in forwardedTypes.Children)
			{
				var forwardedServiceTypeName = forwardedType.Attributes["service"];
				try
				{
					services.Add(converter.PerformConversion<Type>(forwardedServiceTypeName));
				}
				catch (ConverterException e)
				{
					throw new ComponentRegistrationException(
						string.Format("Component {0} defines invalid forwarded type.", component.Attributes["id"]), e);
				}
			}
		}
开发者ID:jmuralimohanbabu,项目名称:Castle.Windsor,代码行数:22,代码来源:DefaultComponentInstaller.cs

示例12: DeserializeComponent

		private static void DeserializeComponent(XmlNode node, IConfigurationStore store, IConversionManager converter)
		{
			var config = XmlConfigurationDeserializer.GetDeserializedNode(node);
			var id = config.Attributes["id"];
			if(string.IsNullOrEmpty(id))
			{
				var type = converter.PerformConversion<Type>(config.Attributes["type"]);
				id = type.FullName;
				config.Attributes["id"] = id;
				config.Attributes.Add("id-automatic", true.ToString());
			}
			AddComponentConfig(id, config, store);
		}
开发者ID:Orvid,项目名称:NAntUniversalTasks,代码行数:13,代码来源:XmlInterpreter.cs

示例13: SynchronizeMetaInfoStore

		/// <summary>
		///   Initializes a new instance of the <see cref = "SynchronizeMetaInfoStore" /> class.
		/// </summary>
		/// <param name = "conversionManager"></param>
		public SynchronizeMetaInfoStore(IConversionManager conversionManager)
		{
			converter = conversionManager;
		}
开发者ID:castleproject,项目名称:Windsor,代码行数:8,代码来源:SynchronizeMetaInfoStore.cs

示例14: SetUpComponents

		protected virtual void SetUpComponents(IConfiguration[] configurations, IWindsorContainer container, IConversionManager converter)
		{
			foreach(IConfiguration component in configurations)
			{
				var id = component.Attributes["id"];
				
				var typeName = component.Attributes["type"];
				var serviceTypeName = component.Attributes["service"];
				
				if (string.IsNullOrEmpty(typeName)) continue;
				
				Type type = ObtainType(typeName,converter);
				Type service = type;

				if (!string.IsNullOrEmpty(serviceTypeName))
				{
					service = ObtainType(serviceTypeName,converter);
				}

				AssertImplementsService(id, service, type);


				Debug.Assert( id != null );
				Debug.Assert( type != null );
				Debug.Assert( service != null );
				container.AddComponent(id, service, type);
				SetUpComponentForwardedTypes(container, component, typeName, id,converter);

			}
		}
开发者ID:AGiorgetti,项目名称:Castle.InversionOfControl,代码行数:30,代码来源:DefaultComponentInstaller.cs

示例15: CreateOnUIThreadInspector

		/// <summary>
		///   Initializes a new instance of the <see cref = "CreateOnUIThreadInspector" /> class.
		/// </summary>
		/// <param name = "config">The config.</param>
		/// <param name = "converter"></param>
		public CreateOnUIThreadInspector(IConfiguration config, IConversionManager converter)
		{
			marshalingControl = new MarshalingControl();
			controlProxyHook = ObtainProxyHook(config, converter);
		}
开发者ID:castleproject,项目名称:Windsor,代码行数:10,代码来源:CreateOnUIThreadInspector.cs


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