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


C# IWindsorContainer.Release方法代码示例

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


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

示例1: CreateBus

        private static Bus CreateBus(IWindsorContainer container, ITypeProvider typeProvider)
        {
            var configRetriever = container.Resolve<IGetEnvironmentConfiguration>();
            
            try
            {
                // Get the Azure Service Bus connection string, app name, and unique name for this running instance
                string connectionString = configRetriever.GetSetting(AzureServiceBusConnectionStringKey);
                string appName = configRetriever.AppName;
                string uniqueName = configRetriever.UniqueInstanceId;

                Bus bus = new BusBuilder().Configure()
                                          .WithConnectionString(connectionString)
                                          .WithNames(appName, uniqueName)
                                          .WithJsonSerializer()
                                          .WithWindsorDefaults(container)
                                          .WithTypesFrom(typeProvider)
                                          .Build();
                bus.Start();
                return bus;
            }
            finally
            {
                container.Release(configRetriever);
            }
        }
开发者ID:johnbabb,项目名称:killrvideo-csharp,代码行数:26,代码来源:NimbusWindsorInstaller.cs

示例2: RegisterPackages

 public void RegisterPackages(IWindsorContainer container, ICollection<RouteBase> routes, ICollection<IViewEngine> engines)
 {
     var manager = container.Resolve<IWebPackageManager>();
     manager.LocatePackages();
     manager.RegisterPackages(routes, engines);
     container.Release(manager);
 }
开发者ID:Eilon,项目名称:spark,代码行数:7,代码来源:Application.cs

示例3: AddConfigurationFromContainer

 public static void AddConfigurationFromContainer(IWindsorContainer container)
 {
     var genericMappers = container.ResolveAll<IGenericMapperMarker>();
     foreach (var mapperImplementation in genericMappers)
     {
         if (Mapper.FindTypeMapFor(mapperImplementation.GetSourceType(), mapperImplementation.GetDestinationType()) == null)
         {
             Mapper.CreateMap(mapperImplementation.GetSourceType(), mapperImplementation.GetDestinationType());
         }
     }
     container.Release(genericMappers);
 }
开发者ID:Detroier,项目名称:playground,代码行数:12,代码来源:AutoMapperConfiguration.cs

示例4: CreatePrintContext

 public static PrintContext CreatePrintContext(
   this RecordDataKeeper dataSubject, IWindsorContainer container) {
   var f = container.Resolve<PrintContextFactory>();
   try {
     return f.Create(
       dataSubject.GetCalledMethods().First(), 
       s => new SimpleNameEnumerator(s),
       new PrintFormattingImpl(),
       new PrintNamingImpl());
   }
   finally {
     container.Release(f);
   }
 }
开发者ID:Prover,项目名称:Prover.SpecWriter,代码行数:14,代码来源:RecordDataKeeperEx.cs

示例5: StressTest

		public void StressTest()
		{
			container = new WindsorContainer(TestHelper.GetConfigDir()+"WindsorContainerTest.xml");
			IProcessDefinitionService definitionSession = null;

			for (int i=1;i<20;i++)
			{
				definitionSession = (IProcessDefinitionService) container["DefinitionSession"];
				Assert.IsNotNull(definitionSession);
				definitionSession = (IProcessDefinitionService) container[typeof (IProcessDefinitionService)];
				Assert.IsNotNull(definitionSession);
				container.Release(definitionSession);
				definitionSession=null;
			}
		}
开发者ID:JackWangCUMT,项目名称:netbpm,代码行数:15,代码来源:WindsorContainerTest.cs

示例6: RegisterRoutes

        protected void RegisterRoutes(RouteCollection routes, ref IWindsorContainer Container)
        {
            var plugins = Container.ResolveAll<IPlugin>();

            foreach (var plugin in plugins)
            {
                plugin.RegisterRoutes(routes);
            }

            Container.Release(plugins);

            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.IgnoreRoute("{resource}.ico/{*pathInfo}");
            routes.IgnoreRoute("Scripts/");
            routes.IgnoreRoute("Content/");
            routes.IgnoreRoute("Data/");

            routes.MapRoute(
                "Default", // Route name,
                "{controller}/{action}/{id}", // URL with parameters
                new {controller = "Home", action = "Index", id = UrlParameter.Optional} // Parameter defaults
                );
        }
开发者ID:supermuk,项目名称:iudico,代码行数:23,代码来源:ChangingLanguageTestsTests.cs

示例7: ExecuteCompositionRoot

        static void ExecuteCompositionRoot(string[] args, IWindsorContainer container)
        {
            _logger.Info("IoC successflly configured");

            var execContext = container.Resolve<IExecutionContext>();
            execContext.StartReading(); //starting keyboard control
            _logger.Info("Execution context started");

            var server = container.Resolve<IWebServer>();

            try
            {
                //CreateTestData(container);
                server.Start();

                Console.WriteLine("Press a key>");
                Console.ReadLine();

                server.Stop();
            }
            finally
            {
                _logger.Info("Final releasing");

                container.Release(server);
                execContext.CancelSource.Cancel();
                container.Release(execContext);
            }
        }
开发者ID:alexf2,项目名称:ReactiveWebServerProto,代码行数:29,代码来源:Program.cs

示例8: WithSession

 private static void WithSession(
     IWindsorContainer container, Action<IDocumentSession> action)
 {
     using (container.BeginScope())
     {
         var session = container.Resolve<IDocumentSession>();
         action.Invoke(session);
         session.SaveChanges();
         container.Release(session);
     }
 }
开发者ID:dlidstrom,项目名称:EventStoreLite,代码行数:11,代码来源:Program.cs

示例9: WithEventStore

 private static void WithEventStore(IWindsorContainer container, Action<IDocumentSession, IEventStoreSession> action)
 {
     using (container.BeginScope())
     {
         var store = container.Resolve<IDocumentStore>();
         var session = container.Resolve<IDocumentSession>();
         var eventStore = container.Resolve<EventStore>();
         var eventStoreSession = eventStore.OpenSession(store, session);
         action.Invoke(session, eventStoreSession);
         eventStoreSession.SaveChanges();
         container.Release(session);
     }
 }
开发者ID:dlidstrom,项目名称:EventStoreLite,代码行数:13,代码来源:Program.cs

示例10: RegisterPackages

        void RegisterPackages(IWindsorContainer container, ICollection<RouteBase> routes, ICollection<IViewEngine> engines)
        {
            LocatePackages(container);

              var remainingPackages = container.Kernel.GetHandlers(typeof(IWebPackage));

              while (remainingPackages.Any())
              {
            var validPackages = remainingPackages
              .Where(handler => handler.CurrentState == HandlerState.Valid)
              .ToArray();

            if (!validPackages.Any())
            {
              break;
            }

            foreach (var handler in validPackages)
            {
              var package = container.Resolve<IWebPackage>(handler.ComponentModel.Name);
              package.Register(container, routes, engines);
              container.Release(package);
            }

            remainingPackages = remainingPackages.Except(validPackages).ToArray();
              }

              if (!remainingPackages.Any())
              {
            return;
              }

              var message =
            String.Format(
                      "Web packages have unresolved dependencies. The following packages could not be installed: {0}",
                      String.Join(", ", remainingPackages.Select(x => x.ComponentModel.Implementation)));

              throw new ApplicationException(message);
        }
开发者ID:agross,项目名称:composite-ui-with-spark,代码行数:39,代码来源:WebPackageInstaller.cs


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