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


C# IKernel.Load方法代码示例

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

示例2: LoadModules

 public void LoadModules(IKernel kernel)
 {
     kernel.Load<GeneratorsModule>();
     kernel.Load<SelectorsModule>();
     kernel.Load<MappersModule>();
     kernel.Load<TablesModule>();
 }
开发者ID:DnDGen,项目名称:CharacterGen,代码行数:7,代码来源:CharacterGenModuleLoader.cs

示例3: NhBlogServiceTests

 public NhBlogServiceTests()
 {
     _kernel = new StandardKernel();
     _kernel.Load(new NinjectModules());
     _kernel.Load(new NhNinjectModule());
     _kernel.Rebind<IBlogRepository>().To<NhBlogRepository>();
 }
开发者ID:ThomasSchmidt,项目名称:MixedStuff,代码行数:7,代码来源:NhBlogServiceTests.cs

示例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();
        }
开发者ID:joelpitk,项目名称:pitpack,代码行数:28,代码来源:Program.cs

示例5: NinjectDependencyResolver

 public NinjectDependencyResolver()
 {
     nKernel=new StandardKernel();
     nKernel.Load(new EFInjectionModule());
     nKernel.Load(new CoreInjectionModule());
     //AddBindings();
 }
开发者ID:xi33,项目名称:ShaBoo2.x-Base-Framework,代码行数:7,代码来源:NinjectDependencyResolver.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)
		{
			kernel.Load<StorageModuleForWCF>();
			kernel.Load<LogicModule>();
			kernel.Load<TaskQueueModule>();
			kernel.Load<DocumentGenerationLogicModule>();
		}
开发者ID:evkap,项目名称:DVS,代码行数:11,代码来源:NinjectWebCommon.cs

示例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))));


        }        
开发者ID:AnthonyYates,项目名称:brewgr.com,代码行数:11,代码来源:NinjectWebCommon.cs

示例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());
        }
开发者ID:dustinchilson,项目名称:blog,代码行数:8,代码来源:BootStrapper.cs

示例9: ConfigureKernel

 public void ConfigureKernel(IKernel kernel)
 {
     kernel.Load<ProtogameCoreModule>();
     kernel.Load<ProtogameAssetIoCModule>();
     kernel.Load<ProtogameEventsIoCModule>();
     kernel.Load<ProtogameSensorModule>();
     kernel.Load<AugmentedBoardGameModule>();
 }
开发者ID:hach-que,项目名称:Augmented-Board-Game,代码行数:8,代码来源:AugmentedBoardGameGameConfiguration.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.Load<DataAccessModule>();
            kernel.Load<DomainModule>();
            kernel.Load<CommandModule>();

            DatabaseHelper.PopulateDatabase(kernel);
        }
开发者ID:spcboog,项目名称:budgomatic,代码行数:12,代码来源:NinjectWebCommon.cs

示例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>();
		}
开发者ID:evkap,项目名称:DVS,代码行数:14,代码来源:NinjectWebCommon.cs

示例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"));
        }
开发者ID:phillee007,项目名称:youconf,代码行数:15,代码来源:NinjectWebCommon.cs

示例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>();
        }
开发者ID:hansel0691,项目名称:VirtualOffice,代码行数:13,代码来源:VistualOfficeResolver.cs

示例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"));
        }
开发者ID:shawnewallace,项目名称:my-book-list,代码行数:18,代码来源:NinjectWebCommon.cs

示例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);
        }
开发者ID:iringtools,项目名称:sp_3d,代码行数:49,代码来源:Test.cs


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