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


C# StandardKernel.Load方法代码示例

本文整理汇总了C#中StandardKernel.Load方法的典型用法代码示例。如果您正苦于以下问题:C# StandardKernel.Load方法的具体用法?C# StandardKernel.Load怎么用?C# StandardKernel.Load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在StandardKernel的用法示例。


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

示例1: SetUp

        public void SetUp()
        {
            IKernel kernel = new StandardKernel(new NinjectSettings {LoadExtensions = false});
            kernel.Load(new LinFuModule());
            kernel.Load(new TransactionalAnnotationTestModule());

            _targetService = kernel.Get<ITargetService>();
            _interceptor = (TestTransactionInterceptor) kernel.Get<ITransactionInterceptor>();
        }
开发者ID:cessationoftime,项目名称:ninject.extensions.spring.tx,代码行数:9,代码来源:TransactionalAnnotationTest.cs

示例2: IsNotOnGroundWhenNoEntities

 public void IsNotOnGroundWhenNoEntities()
 {
     var kernel = new StandardKernel();
     kernel.Load<ProtogameCoreModule>();
     kernel.Load<ProtogamePlatformingIoCModule>();
     var platforming = kernel.Get<IPlatforming>();
     _assert.False(platforming.IsOnGround(
         this.CreateBoundingBox(200, 200, 16, 16),
         new IBoundingBox[0],
         x => true));
 }
开发者ID:RedpointGames,项目名称:Protogame,代码行数:11,代码来源:PlatformingModuleTests.cs

示例3: IsNotOnGroundWhenOnlyEntity

 public void IsNotOnGroundWhenOnlyEntity()
 {
     var kernel = new StandardKernel();
     kernel.Load<ProtogameCoreModule>();
     kernel.Load<ProtogamePlatformingIoCModule>();
     var platforming = kernel.Get<IPlatforming>();
     var entity = this.CreateBoundingBox(200, 200, 16, 16);
     _assert.False(platforming.IsOnGround(
         entity,
         new[] { entity },
         x => true));
 }
开发者ID:RedpointGames,项目名称:Protogame,代码行数:12,代码来源:PlatformingModuleTests.cs

示例4: IsNotOnGroundWhenJustAboveTheGround

 public void IsNotOnGroundWhenJustAboveTheGround()
 {
     var kernel = new StandardKernel();
     kernel.Load<ProtogameCoreModule>();
     kernel.Load<ProtogamePlatformingIoCModule>();
     var platforming = kernel.Get<IPlatforming>();
     var player = this.CreateBoundingBox(200, 200 - 17, 16, 16);
     var ground = this.CreateBoundingBox(0, 200, 400, 16);
     _assert.False(platforming.IsOnGround(
         player,
         new[] { player, ground },
         x => true));
 }
开发者ID:RedpointGames,项目名称:Protogame,代码行数:13,代码来源:PlatformingModuleTests.cs

示例5: IsNotOverlappingWhenNoBoundingBoxes

 public void IsNotOverlappingWhenNoBoundingBoxes()
 {
     var kernel = new StandardKernel();
     kernel.Load<ProtogameCoreModule>();
     var boundingBoxUtilities = kernel.Get<IBoundingBoxUtilities>();
     _assert.False(boundingBoxUtilities.Overlaps());
 }
开发者ID:RedpointGames,项目名称:Protogame,代码行数:7,代码来源:BoundingBoxTests.cs

示例6: IsNotOverlappingWhenOneBoundingBox

 public void IsNotOverlappingWhenOneBoundingBox()
 {
     var kernel = new StandardKernel();
     kernel.Load<ProtogameCoreModule>();
     var boundingBoxUtilities = kernel.Get<IBoundingBoxUtilities>();
     _assert.False(boundingBoxUtilities.Overlaps(this.CreateBoundingBox(200, 200, 16, 16)));
 }
开发者ID:RedpointGames,项目名称:Protogame,代码行数:7,代码来源:BoundingBoxTests.cs

示例7: ReplaceMapper

 public void ReplaceMapper() {
     var c = new StandardKernel();
     var mapper = new global::SolrNet.Tests.Mocks.MReadOnlyMappingManager();
     c.Load(new SolrNetModule("http://localhost:8983/solr") {Mapper = mapper});
     var m = c.Get<IReadOnlyMappingManager>();
     Assert.AreSame(mapper, m);
 }
开发者ID:FilipVV,项目名称:SolrNet,代码行数:7,代码来源:NinjectFixture.cs

示例8: IsNotOverlappingWhenSameBoundingBoxAndNoOtherBoxes

 public void IsNotOverlappingWhenSameBoundingBoxAndNoOtherBoxes()
 {
     var kernel = new StandardKernel();
     kernel.Load<ProtogameCoreModule>();
     var boundingBoxUtilities = kernel.Get<IBoundingBoxUtilities>();
     var entity = this.CreateBoundingBox(200, 200, 16, 16);
     _assert.False(boundingBoxUtilities.Overlaps(entity, entity));
 }
开发者ID:RedpointGames,项目名称:Protogame,代码行数:8,代码来源:BoundingBoxTests.cs

示例9: CreateKernel

		protected override IKernel CreateKernel()
		{
			var kernel = new StandardKernel();

			kernel.Load<PersistenceModule>();

			return kernel;
		}
开发者ID:mpareja,项目名称:ninject.website,代码行数:8,代码来源:NinjectWebsiteApplication.cs

示例10: Ping_And_Query

 public void Ping_And_Query()
 {
     var c = new StandardKernel();
     c.Load(new SolrNetModule("http://localhost:8983/solr"));
     var solr = c.Get<ISolrOperations<Entity>>();
     solr.Ping();
     Console.WriteLine(solr.Query(SolrQuery.All).Count);
 }
开发者ID:Cort01,项目名称:SolrNet,代码行数:8,代码来源:Tests.cs

示例11: ReplaceMapper

 public void ReplaceMapper()
 {
     var c = new StandardKernel();
     var mapper = MockRepository.GenerateMock<IReadOnlyMappingManager>();
     c.Load(new SolrNetModule("http://localhost:8983/solr") {Mapper = mapper});
     var m = c.Get<IReadOnlyMappingManager>();
     Assert.AreSame(mapper, m);
 }
开发者ID:Cort01,项目名称:SolrNet,代码行数:8,代码来源:Tests.cs

示例12: IsOverlappingWhenDifferentBoundingBoxes

 public void IsOverlappingWhenDifferentBoundingBoxes()
 {
     var kernel = new StandardKernel();
     kernel.Load<ProtogameCoreModule>();
     var boundingBoxUtilities = kernel.Get<IBoundingBoxUtilities>();
     _assert.True(boundingBoxUtilities.Overlaps(
         this.CreateBoundingBox(200, 200, 16, 16),
         this.CreateBoundingBox(200, 200, 16, 16)));
 }
开发者ID:RedpointGames,项目名称:Protogame,代码行数:9,代码来源:BoundingBoxTests.cs

示例13: Main

        static void Main(string[] args)
        {
            IKernel _Kernal = new StandardKernel();
            _Kernal.Load(Assembly.GetExecutingAssembly());
            ISMSService _SMSService = _Kernal.Get<ISMSService>();

            UIHandler _UIHandler = new UIHandler(_SMSService);
            _UIHandler.SendConfirmationMsg("96279544480");

            Console.ReadLine();
        }
开发者ID:modulexcite,项目名称:NinjectSample,代码行数:11,代码来源:Program.cs

示例14: ConventionsCanBeUsedInModules

        public void ConventionsCanBeUsedInModules()
        {
            using (IKernel kernel = new StandardKernel())
            {
                kernel.Load<TestModule>();
                var instance = kernel.Get<IDefaultConvention>();

                instance.Should().NotBeNull();
                instance.Should().BeOfType<DefaultConvention>();
            }
        }
开发者ID:regisbsb,项目名称:Ninject.Extensions.Conventions,代码行数:11,代码来源:ModuleLoadingTest.cs

示例15: SetUp

        public void SetUp()
        {
            IKernel kernel = new StandardKernel(new NinjectSettings { LoadExtensions = false });
            kernel.Load(new LinFuModule());
            kernel.Load(new TransactionsModule());
            

            // TODO externalise the test database connection information
            IDbProvider dbProvider = DbProviderFactory.GetDbProvider("MySql.Data.MySqlClient");
            dbProvider.ConnectionString = "SERVER=localhost; DATABASE=chameleon; UID=root; PASSWORD=;";

            kernel.Bind<IDbProvider>().ToConstant(dbProvider).InSingletonScope();

            _adoTemplate = kernel.Get<AdoTemplate>();
            _service = kernel.Get<Service>();

            _adoTemplate.ExecuteNonQuery(CommandType.Text,
                                         "CREATE TABLE IF NOT EXISTS TransactionIntegrationTest ("
                                         + "   id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, "
                                         + "   `name` VARCHAR(100)" + ");"
                                         + "TRUNCATE TABLE TransactionIntegrationTest;");
        }
开发者ID:cessationoftime,项目名称:ninject.extensions.spring.tx,代码行数:22,代码来源:TransactionIntegrationTest.cs


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