本文整理汇总了C#中IKernel类的典型用法代码示例。如果您正苦于以下问题:C# IKernel类的具体用法?C# IKernel怎么用?C# IKernel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IKernel类属于命名空间,在下文中一共展示了IKernel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: ProcessModel
/// <summary>
/// Searches for the component activator in the configuration and, if unsuccessful
/// look for the component activator attribute in the implementation type.
/// </summary>
/// <param name = "kernel">The kernel instance</param>
/// <param name = "model">The model instance</param>
public virtual void ProcessModel(IKernel kernel, ComponentModel model)
{
if (!ReadComponentActivatorFromConfiguration(model))
{
ReadComponentActivatorFromType(model);
}
}
开发者ID:pil0t,项目名称:Castle.Windsor,代码行数:13,代码来源:ComponentActivatorInspector.cs
示例17: 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<RestContext>().ToSelf().InRequestScope();
kernel.Bind<IRecipeRepository>().To<RecipeRepository>().InRequestScope();
kernel.Bind<ILanguageProvider>().To<LanguageProvider>().InRequestScope();
kernel.Bind<IRestaurantRepository>().To<RestaurantRepository>().InRequestScope();
}
开发者ID:Buccaneer,项目名称:3d-mobi-05-eva-rest-back-end,代码行数:11,代码来源:NinjectWebCommon.cs
示例18: 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<EntitiesContext>().InRequestScope();
kernel.Bind<IDepartmentService>().To<DepartmentService>().InRequestScope();
kernel.Bind<IGroupService>().To<GroupService>().InRequestScope();
#region category
kernel.Bind<ICityCateService>().To<CityCateService>().InRequestScope();
kernel.Bind<IFileCateService>().To<FileCateService>().InRequestScope();
kernel.Bind<IRuleCateService>().To<RuleCateService>().InRequestScope();
kernel.Bind<IJobCateService>().To<JobCateService>().InRequestScope();
kernel.Bind<IContractCateService>().To<ContractCateService>().InRequestScope();
kernel.Bind<IJobTitleCateService>().To<JobTitleCateService>().InRequestScope();
kernel.Bind<IRelationCateService>().To<RelationCateService>().InRequestScope();
kernel.Bind<IIndustryCateService>().To<IndustryCateService>().InRequestScope();
kernel.Bind<ICustomerCateService>().To<CustomerCateService>().InRequestScope();
kernel.Bind<ICoopCateService>().To<CoopCateService>().InRequestScope();
kernel.Bind<ISourceCateService>().To<SourceCateService>().InRequestScope();
#endregion
kernel.Bind<ICustomerCompanyService>().To<CustomerCompanyService>().InRequestScope();
kernel.Bind<ICustomerShareService>().To<CustomerShareService>().InRequestScope();
kernel.Bind<ICustomerService>().To<CustomerService>().InRequestScope();
kernel.Bind<IMemberService>().To<MemberService>().InRequestScope();
kernel.Bind<IMember_ActionService>().To<Member_ActionService>().InRequestScope();
kernel.Bind<IPlanLogService>().To<PlanLogService>().InRequestScope();
}
开发者ID:navy235,项目名称:CrmPro,代码行数:33,代码来源:NinjectWebCommon.cs
示例19: 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
示例20: BindAzureBlobServices
private static void BindAzureBlobServices(IKernel kernel)
{
// Bind to the Images blob container for DogController
kernel.Bind<IBlobRepository>().To<K9BlobRepository>()
.WhenInjectedInto<DogController>()
.WithConstructorArgument("connectionString",
ConfigurationManager.AppSettings["StorageAccountConnectionString"])
.WithConstructorArgument("imageContainer",
ConfigurationManager.AppSettings["ImageBlobContainerName"]);
// Bind to the Medical Records blob container for MedicalRecordsController
kernel.Bind<IBlobRepository>().To<K9BlobRepository>()
.WhenInjectedInto<MedicalRecordsController>()
.WithConstructorArgument("connectionString",
ConfigurationManager.AppSettings["StorageAccountConnectionString"])
.WithConstructorArgument("imageContainer",
ConfigurationManager.AppSettings["MedicalRecordBlobContainerName"]);
// Bind to the Notes blob container for MedicalRecordsController
kernel.Bind<IBlobRepository>().To<K9BlobRepository>()
.WhenInjectedInto<NotesController>()
.WithConstructorArgument("connectionString",
ConfigurationManager.AppSettings["StorageAccountConnectionString"])
.WithConstructorArgument("imageContainer",
ConfigurationManager.AppSettings["NotesBlobContainerName"]);
}
开发者ID:paulirwin,项目名称:k94warriors,代码行数:26,代码来源:NinjectWebCommon.cs
注:本文中的IKernel类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论