本文整理汇总了C#中IKernel.Load方法的典型用法代码示例。如果您正苦于以下问题:C# IKernel.Load方法的具体用法?C# IKernel.Load怎么用?C# IKernel.Load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IKernel
的用法示例。
在下文中一共展示了IKernel.Load方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RegisterServices
/// <summary>
/// Load your modules or register your services here!
/// </summary>
/// <param name="kernel">The kernel.</param>
private static void RegisterServices(IKernel kernel)
{
kernel.Load<LogicStorageModule>();
kernel.Load<LogicModule>();
kernel.Load<LogicBackgroundTasksModule>();
kernel.Load<DocumentGenerationLogicModule>();
kernel.Load<ControllerModule>();
ControllerBuilder.Current.SetControllerFactory(new ControllerFactory(kernel));
GlobalFilters.Filters.Add(kernel.Get<DVSRequireHttpsAttribute>());
GlobalFilters.Filters.Add(kernel.Get<DVSAuthorizeFilterAttribute>());
FilterProviders.Providers.Add(kernel.Get<UserAccessHelperFilterProvider>());
FilterProviders.Providers.Add(kernel.Get<ValidateAntiForgeryTokenFilter>());
ModelValidatorProviders.Providers.Add(kernel.Get<EnumValidationProvider>());
ModelValidatorProviders.Providers.Add(kernel.Get<RequiredWhenTrueValidationProvider>());
ModelValidatorProviders.Providers.Add(kernel.Get<BooleanRequiredValidationProvider>());
ModelValidatorProviders.Providers.Add(kernel.Get<ValidationTypeRequiredValidationProvider>());
ModelValidatorProviders.Providers.Add(kernel.Get<PasswordStrengthValidationProvider>());
ModelValidatorProviders.Providers.Add(kernel.Get<DateValidationProvider>());
ModelValidatorProviders.Providers.Add(kernel.Get<RequiredPropertyConditionValidationProvider>());
ModelValidatorProviders.Providers.Add(kernel.Get<StateServerValidationProvider>());
ModelValidatorProviders.Providers.Add(kernel.Get<ReferenceValidationProvider>());
}
示例2: LoadModules
public void LoadModules(IKernel kernel)
{
kernel.Load<GeneratorsModule>();
kernel.Load<SelectorsModule>();
kernel.Load<MappersModule>();
kernel.Load<TablesModule>();
}
示例3: NhBlogServiceTests
public NhBlogServiceTests()
{
_kernel = new StandardKernel();
_kernel.Load(new NinjectModules());
_kernel.Load(new NhNinjectModule());
_kernel.Rebind<IBlogRepository>().To<NhBlogRepository>();
}
示例4: Main
private static void Main(string[] args)
{
errorWriter = new StreamWriter("error.log");
AppDomain.CurrentDomain.UnhandledException += OnUnhandledException;
kernel = new StandardKernel();
kernel.Load<DefaultModule>();
//TODO: IConfiguration. Unit tests!
int configuredMaxTableSize = Convert.ToInt32(ConfigurationManager.AppSettings["MaximumTableSize"]);
int maxTableSize = configuredMaxTableSize <= 255 ? 10000 : configuredMaxTableSize;
if(ConfigurationManager.AppSettings["DataStructureToUse"] == "BinarySearchTree")
{
kernel.Load(new BinarySearchTreeModule(maxTableSize));
}
else
{
kernel.Load(new FrameworkDictionaryModule(maxTableSize));
}
var argumentParser = kernel.Get<CommandLineArgumentParser>();
ICommand command = argumentParser.Parse(args);
command.Execute();
kernel.Dispose();
errorWriter.Dispose();
}
示例5: NinjectDependencyResolver
public NinjectDependencyResolver()
{
nKernel=new StandardKernel();
nKernel.Load(new EFInjectionModule());
nKernel.Load(new CoreInjectionModule());
//AddBindings();
}
示例6: RegisterServices
/// <summary>
/// Load your modules or register your services here!
/// </summary>
/// <param name="kernel">The kernel.</param>
private static void RegisterServices(IKernel kernel)
{
kernel.Load<StorageModuleForWCF>();
kernel.Load<LogicModule>();
kernel.Load<TaskQueueModule>();
kernel.Load<DocumentGenerationLogicModule>();
}
示例7: RegisterServices
/// <summary>
/// Load your modules or register your services here!
/// </summary>
/// <param name="kernel">The kernel.</param>
private static void RegisterServices(IKernel kernel)
{
kernel.Load(new Dependencies());
kernel.Load(new AutoMapperModule(Assembly.GetAssembly(typeof(BrewgrController))));
}
示例8: ConfigureApplicationContainer
protected override void ConfigureApplicationContainer(IKernel existingContainer)
{
existingContainer.Bind(typeof(IConfigurator)).To(typeof(Configurator));
existingContainer.Load(new ModelBinder());
existingContainer.Load(new RepositoryBinder());
existingContainer.Load(new ControllerBinder());
}
示例9: ConfigureKernel
public void ConfigureKernel(IKernel kernel)
{
kernel.Load<ProtogameCoreModule>();
kernel.Load<ProtogameAssetIoCModule>();
kernel.Load<ProtogameEventsIoCModule>();
kernel.Load<ProtogameSensorModule>();
kernel.Load<AugmentedBoardGameModule>();
}
示例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.Load<DataAccessModule>();
kernel.Load<DomainModule>();
kernel.Load<CommandModule>();
DatabaseHelper.PopulateDatabase(kernel);
}
示例11: RegisterServices
/// <summary>
/// Load your modules or register your services here!
/// </summary>
/// <param name="kernel">The kernel.</param>
private static void RegisterServices(IKernel kernel)
{
kernel.Load<StorageModuleForDocumentGenerationWebService>();
kernel.Load<LogicModule>();
kernel.Load<TaskQueueModule>();
kernel.Bind<IAppraiserAccessManager>().To<AppraiserAccessManager>().WithConstructorArgument("httpContext", x => new HttpContextWrapper(HttpContext.Current));
kernel.Bind<IClientUserAccessManager>().To<ClientUserAccessManager>().WithConstructorArgument("httpContext", x => new HttpContextWrapper(HttpContext.Current));
kernel.Bind<IAVMResponseManager>().To<AVMResponseManager>();
}
示例12: RegisterServices
/// <summary>
/// Load your modules or register your services here!
/// </summary>
/// <param name="kernel">The kernel.</param>
private static void RegisterServices(IKernel kernel)
{
kernel.Load(Assembly.GetExecutingAssembly());
kernel.Bind<Func<IKernel>>().ToMethod(ctx => () => new Bootstrapper().Kernel);
kernel.Bind<IHttpModule>().To<HttpApplicationInitializationHttpModule>();
kernel.Bind<IYouConfDbContext>().To<YouConfDbContext>()
.InRequestScope();
kernel.Bind<IMailSender>().To<SmtpMailSender>();
kernel.Load(new SolrNetModule("http://youconfsearchv1.cloudapp.net/solr"));
}
示例13: Bind
private void Bind()
{
var settings = new NinjectSettings { LoadExtensions = true };
_kernel = new StandardKernel(settings);
_kernel.Bind<IInterceptor>().To<LoggingInterceptor>();
_kernel.Load(new DataModule(), new LoggerModule(), new BlackstoneDbModule(), new InventoryModule());
_kernel.Load(new ServiceModule(GetLoggingInterceptor()));
//_kernel.Get<OrdersController>();
}
示例14: 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<IProfileService>().To<ProfileService>();
//kernel.Bind<IReviewService>().To<ReviewService>();
//kernel.Bind<IReviewYearService>().To<ReviewYearService>();
//kernel.Bind<IAnnualScoreService>().To<AnnualScoreService>();
//kernel.Bind<ICalculationScoreWeightService>().To<CalculationScoreWeightService>();
kernel.Bind<IBookRepository>().To<BookRepository>();
kernel.Bind<IUserProfileRepository>().To<UserProfileRepository>();
kernel.Load(Assembly.Load("Griz.Core"));
kernel.Load(Assembly.Load("Griz.BookList.Lib"));
}
示例15: SP3DDataLayerTest
public SP3DDataLayerTest()
{
_settings = new NameValueCollection();
_settings["XmlPath"] = @".\12345_000\";
_settings["ProjectName"] = "12345_000";
_settings["ApplicationName"] = "SP3D";
_baseDirectory = Directory.GetCurrentDirectory();
_baseDirectory = _baseDirectory.Substring(0, _baseDirectory.LastIndexOf("\\bin"));
_settings["BaseDirectoryPath"] = _baseDirectory;
Directory.SetCurrentDirectory(_baseDirectory);
_adapterSettings = new AdapterSettings();
_adapterSettings.AppendSettings(_settings);
string appSettingsPath = String.Format("{0}12345_000.SP3D.config",
_adapterSettings["XmlPath"]
);
if (File.Exists(appSettingsPath))
{
AppSettingsReader appSettings = new AppSettingsReader(appSettingsPath);
_adapterSettings.AppendSettings(appSettings);
}
var ninjectSettings = new NinjectSettings { LoadExtensions = false };
_kernel = new StandardKernel(ninjectSettings);
_kernel.Load(new XmlExtensionModule());
string relativePath = String.Format(@"{0}BindingConfiguration.{1}.{2}.xml",
_settings["XmlPath"],
_settings["ProjectName"],
_settings["ApplicationName"]
);
//Ninject Extension requires fully qualified path.
string bindingConfigurationPath = Path.Combine(
_settings["BaseDirectoryPath"],
relativePath
);
_kernel.Load(bindingConfigurationPath);
// _sp3dDataLayer = _kernel.Get<SP3DDataLayer>(); This will reset the new updated adaptersettings with default values.
_sp3dDataLayer = new SP3DDataLayer(_adapterSettings);
}