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


C# IKernel类代码示例

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


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

示例1: GetContentProviders

 private static IList<IContentProvider> GetContentProviders(IKernel kernel)
 {
     // Use MEF to locate the content providers in this assembly
     var compositionContainer = new CompositionContainer(new AssemblyCatalog(typeof(ResourceProcessor).Assembly));
     compositionContainer.ComposeExportedValue(kernel);
     return compositionContainer.GetExportedValues<IContentProvider>().ToList();
 }
开发者ID:Widdershin,项目名称:vox,代码行数:7,代码来源:ResourceProcessor.cs

示例2: RegisterIMappingEngine

 private void RegisterIMappingEngine(IKernel kernel)
 {
     kernel.Register(
         Component.For<IMappingEngine>()
             .UsingFactoryMethod(k => new MappingEngine(kernel.Resolve<IConfigurationProvider>()))
     );
 }
开发者ID:bhaktapk,项目名称:com-prerit,代码行数:7,代码来源:AutoMapperRegistration.cs

示例3: RegisterServices

 /// <summary>
 /// Load your modules or register your services here!
 /// </summary>
 /// <param name="kernel">The kernel.</param>
 private static void RegisterServices(IKernel kernel)
 {
     // Load BusinessLogic plugin
       kernel.Bind<ISiteManager>().To<SiteManager>();
       kernel.Bind<ISupplierManager>().To<SupplierManager>();
       kernel.Bind<IProductManager>().To<ProductManager>();
 }
开发者ID:pleinad,项目名称:GAX,代码行数:11,代码来源:NinjectWebCommon.cs

示例4: ProcessModel

		public void ProcessModel(IKernel kernel, ComponentModel model)
		{
			if (model.Configuration == null)
			{
				return;
			}

			var remoteserverAttValue = model.Configuration.Attributes["remoteserver"];
			var remoteclientAttValue = model.Configuration.Attributes["remoteclient"];

			var server = RemotingStrategy.None;
			var client = RemotingStrategy.None;

			if (remoteserverAttValue == null && remoteclientAttValue == null)
			{
				return;
			}

			if (remoteserverAttValue != null)
			{
				server = converter.PerformConversion<RemotingStrategy>(remoteserverAttValue);
			}

			if (remoteclientAttValue != null)
			{
				client = converter.PerformConversion<RemotingStrategy>(remoteclientAttValue);
			}

			DoSemanticCheck(server, model, client);

			ConfigureServerComponent(server, model.Implementation, model);

			ConfigureClientComponent(client, model.Services.Single(), model);
		}
开发者ID:castleproject,项目名称:Windsor,代码行数:34,代码来源:RemotingInspector.cs

示例5: Register

        public override void Register(IKernel kernel)
        {
            AddFacility<FactorySupportFacility>(kernel);

            RegisterIConfigurationProviderAndIProfileExpression(kernel);
            RegisterIMappingEngine(kernel);
        }
开发者ID:bhaktapk,项目名称:com-prerit,代码行数:7,代码来源:AutoMapperRegistration.cs

示例6: RegisterServices

        /// <summary>
        /// Load your modules or register your services here!
        /// </summary>
        /// <param name="kernel">The kernel.</param>
        private static void RegisterServices(IKernel kernel)
        {
            var types = AutoMapperConfig.GetTypesInAssembly();
            var config = AutoMapperConfig.ConfigureAutomapper(types);
            var mapper = config.CreateMapper();

            kernel.Bind<MapperConfiguration>().ToMethod(c => config).InSingletonScope();

            kernel.Bind<IMapper>().ToConstant(mapper);

            kernel.Bind(typeof(IRepository<>)).To(typeof(EfGenericRepository<>));

            kernel.Bind<IDiagnoseMeDbContext>().To<DiagnoseMeDbContext>().InRequestScope();

            kernel.Bind(
                b => 
                    b.From(Assemblies.DataServices)
                        .SelectAllClasses()
                        .BindDefaultInterface());

            kernel.Bind(
                b =>
                    b.From(Assemblies.WebServices)
                        .SelectAllClasses()
                        .BindDefaultInterface());
        }        
开发者ID:InKolev,项目名称:DiagnoseMe,代码行数:30,代码来源:NinjectWebConfig.cs

示例7: Init

		public void Init(IKernel kernel, Castle.Core.Configuration.IConfiguration facilityConfig)
		{
			Assert.IsNotNull(kernel);
			Assert.IsNotNull(facilityConfig);

			Initialized = true;
		}
开发者ID:gschuager,项目名称:Castle.Windsor,代码行数:7,代码来源:HiperFacility.cs

示例8: ProductVariantModelBinder

 public ProductVariantModelBinder(ISetVariantTypeProperties setVariantTypeProperties, ISetRestrictedShippingMethods setRestrictedShippingMethods, ISetETagService setETagService, IKernel kernel)
     : base(kernel)
 {
     _setVariantTypeProperties = setVariantTypeProperties;
     _setRestrictedShippingMethods = setRestrictedShippingMethods;
     _setETagService = setETagService;
 }
开发者ID:neozhu,项目名称:Ecommerce,代码行数:7,代码来源:ProductVariantModelBinder.cs

示例9: ProcessModel

		public void ProcessModel(IKernel kernel, ComponentModel model)
		{
			if (model.Configuration == null)
			{
				return;
			}

			var mixins = model.Configuration.Children["mixins"];
			if (mixins == null)
			{
				return;
			}

			var mixinReferences = new List<ComponentReference<object>>();
			foreach (var mixin in mixins.Children)
			{
				var value = mixin.Value;

				var mixinComponent = ReferenceExpressionUtil.ExtractComponentKey(value);
				if (mixinComponent == null)
				{
					throw new Exception(
						String.Format("The value for the mixin must be a reference to a component (Currently {0})", value));
				}

				mixinReferences.Add(new ComponentReference<object>("mixin-" + mixinComponent, mixinComponent));
			}
			if (mixinReferences.Count == 0)
			{
				return;
			}
			var options = ProxyUtil.ObtainProxyOptions(model, true);
			mixinReferences.ForEach(options.AddMixinReference);
		}
开发者ID:Orvid,项目名称:NAntUniversalTasks,代码行数:34,代码来源:MixinInspector.cs

示例10: RegisterServices

 /// <summary>
 /// Load your modules or register your services here!
 /// </summary>
 /// <param name="kernel">The kernel.</param>
 private static void RegisterServices(IKernel kernel)
 {
     kernel.Bind<IUnitOfWork>().To<DatabaseContext>();
     kernel.Bind<ITrackRepository>().To<TrackRepository>().InRequestScope();
     kernel.Bind<IAlbumRepository>().To<AlbumRepository>().InRequestScope();
     //kernel.Bind<IFilmRepository>().To<FilmRepository>();
 }
开发者ID:smubarak-ali,项目名称:DemoApp,代码行数:11,代码来源:NinjectWebCommon.cs

示例11: ProcessModel

		/// <summary>
		/// Queries the kernel's ConfigurationStore for a configuration
		/// associated with the component name.
		/// </summary>
		/// <param name="kernel"></param>
		/// <param name="model"></param>
		public virtual void ProcessModel(IKernel kernel, ComponentModel model)
		{
			IConfiguration config = kernel.ConfigurationStore.GetComponentConfiguration(model.Name) ??
									kernel.ConfigurationStore.GetBootstrapComponentConfiguration(model.Name);

			model.Configuration = config;
		}
开发者ID:ralescano,项目名称:castle,代码行数:13,代码来源:ConfigurationModelInspector.cs

示例12: ParticlesTest

 public ParticlesTest(IKernel kernel, ContentManager content, GraphicsDevice device)
     : base("Particles", kernel)
 {
     _kernel = kernel;
     _content = content;
     _device = device;
 }
开发者ID:martindevans,项目名称:Myre,代码行数:7,代码来源:ParticlesTest.cs

示例13: Create

		public object Create(IProxyFactoryExtension customFactory, IKernel kernel, ComponentModel model,
		                     CreationContext context, params object[] constructorArguments)
		{
			throw new NotImplementedException(
				"You must supply an implementation of IProxyFactory " +
				"to use interceptors on the Microkernel");
		}
开发者ID:gschuager,项目名称:Castle.Windsor,代码行数:7,代码来源:NotSupportedProxyFactory.cs

示例14: AbstractComponentActivator

		/// <summary>
		///   Constructs an AbstractComponentActivator
		/// </summary>
		protected AbstractComponentActivator(ComponentModel model, IKernel kernel, ComponentInstanceDelegate onCreation, ComponentInstanceDelegate onDestruction)
		{
			this.model = model;
			this.kernel = kernel;
			this.onCreation = onCreation;
			this.onDestruction = onDestruction;
		}
开发者ID:martinernst,项目名称:Castle.Windsor,代码行数:10,代码来源:AbstractComponentActivator.cs

示例15: ActiveFeatureFactory

 public ActiveFeatureFactory(IKernel kernel, IInstanceConfiguration instanceConfiguration, ILog log, ILoggingConfiguration loggingConfiguration)
 {
     _kernel = kernel;
     _instanceConfiguration = instanceConfiguration;
     _log = log;
     _loggingConfiguration = loggingConfiguration;
 }
开发者ID:davidwhitney,项目名称:deployd-micro,代码行数:7,代码来源:ActiveFeatureFactory.cs


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