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


C# IContainer类代码示例

本文整理汇总了C#中IContainer的典型用法代码示例。如果您正苦于以下问题:C# IContainer类的具体用法?C# IContainer怎么用?C# IContainer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: CusCtlTellPanelChar

 public CusCtlTellPanelChar(Liplis.MainSystem.Liplis lips, ObjSetting os, string url, string title, string discription, int newsEmotion, int newsPoint, Bitmap charBody, EventHandler enter, IContainer components)
 {
     this.lips = lips;
     this.os = os;
     initCms(components);
     initDataPanelNonThum(url, title, discription, newsEmotion, newsPoint, charBody, enter);
 }
开发者ID:LipliStyle,项目名称:LiplisDoll,代码行数:7,代码来源:CusCtlTellPanelChar.cs

示例2: DesignModeSite

		public DesignModeSite (IComponent component, string name, IContainer container, IServiceProvider serviceProvider)
		{
			_component = component;
			_container = container;
			_componentName = name;
			_serviceProvider = serviceProvider;
		}
开发者ID:JianwenSun,项目名称:mono-soc-2007,代码行数:7,代码来源:DesignModeSite.cs

示例3: Initialize

 /// <summary>
 /// Base method that initializes the connection on the entity context connection
 /// </summary>
 public virtual void Initialize(IContainer container)
 {
     if (EntityContextConfiguration != null)
     {
         EntityContextConfiguration.Connection.Initialize(container);
     }
 }
开发者ID:LenFon,项目名称:Bifrost,代码行数:10,代码来源:ConfigurationStorageElement.cs

示例4: Detach

 public static void Detach(IContainer container)
 {
     if (Equals(container, Container))
     {
         Container = null;
     }
 }
开发者ID:snipervld,项目名称:StormXamarin,代码行数:7,代码来源:DependencyService.cs

示例5: CloseContainer

 /// <summary>
 /// Close the Defined Container.
 /// </summary>
 public void CloseContainer(IContainer containerSource)
 {
     //TODO: Need Test this Feature. Probably is a Client Packet.
     PacketBuilder Builder = new PacketBuilder(0x6F, connection);
     Builder.Append(containerSource.Index);
     Connection.Send(Builder.GetPacket());
 }
开发者ID:alexisjojo,项目名称:ktibiax,代码行数:10,代码来源:Use.cs

示例6: ConfigureApplication

 protected override void ConfigureApplication(IContainer container)
 {
     var viewFactory = container.Resolve<IViewFactory>();
     var main = viewFactory.Resolve<LoginViewModel>();
     var np = new NavigationPage(main);
     _application.MainPage = np;
 }
开发者ID:alejandrogf,项目名称:RedSocial_Xamarin,代码行数:7,代码来源:Startup.cs

示例7: SilkveilContainerTests

        public SilkveilContainerTests()
        {
            var containerBuilder = new ContainerBuilder();
            containerBuilder.Register(typeof(IContainerBinder), typeof(ContainerBinder));
            containerBuilder.Register(typeof(IRequestListener), typeof(DownloadRequestListener));
            containerBuilder.Register(typeof(IRequestListener), typeof(RedirectRequestListener));
            containerBuilder.Register(typeof(IMappingResolver<IDownloadMapping>), typeof(DownloadMappingResolver));
            containerBuilder.Register(typeof(IMappingResolver<IRedirectMapping>), typeof(RedirectMappingResolver));
            containerBuilder.Register<IMappingProvider<IDownloadMapping>>(
                c =>
                {
                    var downloadMappingProvider = new DownloadMappingProvider(c);
                    downloadMappingProvider.Initialize();
                    return downloadMappingProvider;
                });
            containerBuilder.Register<IMappingProvider<IRedirectMapping>>(
                c =>
                {
                    var redirectMappingProvider = new RedirectMappingProvider(c);
                    redirectMappingProvider.Initialize();
                    return redirectMappingProvider;
                });
            containerBuilder.Register(typeof(IContentSource), typeof(HttpContentSource));
            containerBuilder.Register(typeof(IContentSource), typeof(FileContentSource));
            containerBuilder.Register(typeof(IStreamSplitter), typeof(StreamSplitter));
            containerBuilder.Register(typeof(IHttpStreamFactory), typeof(HttpStreamFactory));
            containerBuilder.Register(typeof(ISilkveilContainer), typeof(SilkveilContainer));

            containerBuilder.Register(typeof(IDownloadMapping), typeof(DownloadMapping));
            containerBuilder.Register(typeof(IRedirectMapping), typeof(RedirectMapping));

            this._container = containerBuilder.Build();
        }
开发者ID:peterbucher,项目名称:silkveil,代码行数:33,代码来源:SilkveilContainerTests.cs

示例8: PathResolver

 /// <summary>
 /// Initializes a new instance of the <see cref="PathResolver"/> class.
 /// </summary>
 /// <param name="session">The session.</param>
 /// <param name="pathData">The path data.</param>
 /// <param name="controllerMapper">The controller mapper.</param>
 /// <param name="container">The container.</param>
 public PathResolver(IDocumentSession session, IPathData pathData, IControllerMapper controllerMapper, IContainer container)
 {
     _pathData = pathData;
     _controllerMapper = controllerMapper;
     _container = container;
     _session = session;
 }
开发者ID:sriv,项目名称:BrickPile,代码行数:14,代码来源:PathResolver.cs

示例9: Application_Start

        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);

            // Register: create and configure the container
            _container = BootstrapContainer();

            DependencyResolver.SetResolver(new AutofacDependencyResolver(_container));

            var builder = new ContainerBuilder();

            //var configurationRepository =
            //    new ConfigurationRepository.ConfigurationRepository() as IConfigurationRepository;

            //builder.Register(c => configurationRepository).As<IConfigurationRepository>().SingleInstance();

            builder.RegisterType<StashCoreApiConsumer>().As<IStashCoreApiConsumer>();

            builder.RegisterType<PullTrackerRepository>().As<IPullTrackerRepository>();

            builder.RegisterType<RequestProcessFacade>().As<IRequestProcessFacade>();

            IContainer localContainer = builder.Build();

            AutofacHelper.Scope = localContainer;

            _containerProvider = new ContainerProvider(localContainer);
        }
开发者ID:rajasekaran18,项目名称:PullTracker,代码行数:31,代码来源:Global.asax.cs

示例10: UsbDs3

        public UsbDs3(IContainer container)
            : base(USB_CLASS_GUID)
        {
            container.Add(this);

            InitializeComponent();
        }
开发者ID:metaxis,项目名称:ScpServer,代码行数:7,代码来源:UsbDs3.cs

示例11: StructureMapDependencyScope

 public StructureMapDependencyScope(IContainer container)
 {
     if (container == null) {
         throw new ArgumentNullException("container");
     }
     Container = container;
 }
开发者ID:imatiqul,项目名称:criccard,代码行数:7,代码来源:StructureMapDependencyScope.cs

示例12: Init

        public void Init() {
            _settingsA = new ShellSettings { Name = "Alpha" };
            _settingsB = new ShellSettings { Name = "Beta", };
            _routes = new RouteCollection();

            var rootBuilder = new ContainerBuilder();
            rootBuilder.Register(ctx => _routes);
            rootBuilder.RegisterType<ShellRoute>().InstancePerDependency();
            rootBuilder.RegisterType<RunningShellTable>().As<IRunningShellTable>().SingleInstance();
            rootBuilder.RegisterModule(new WorkContextModule());
            rootBuilder.RegisterType<WorkContextAccessor>().As<IWorkContextAccessor>().InstancePerMatchingLifetimeScope("shell");
            rootBuilder.RegisterType<HttpContextAccessor>().As<IHttpContextAccessor>();
            rootBuilder.RegisterType<ExtensionManager>().As<IExtensionManager>();
            rootBuilder.RegisterType<StubCacheManager>().As<ICacheManager>();
            rootBuilder.RegisterType<StubAsyncTokenProvider>().As<IAsyncTokenProvider>();
            rootBuilder.RegisterType<StubParallelCacheContext>().As<IParallelCacheContext>();

            _rootContainer = rootBuilder.Build();

            _containerA = _rootContainer.BeginLifetimeScope(
                "shell",
                builder => {
                    builder.Register(ctx => _settingsA);
                    builder.RegisterType<RoutePublisher>().As<IRoutePublisher>().InstancePerMatchingLifetimeScope("shell");
                });

            _containerB = _rootContainer.BeginLifetimeScope(
                "shell",
                builder => {
                    builder.Register(ctx => _settingsB);
                    builder.RegisterType<RoutePublisher>().As<IRoutePublisher>().InstancePerMatchingLifetimeScope("shell");
                });
        }
开发者ID:dioptre,项目名称:nkd,代码行数:33,代码来源:ShellRouteTests.cs

示例13: Dispose

        public void Dispose()
        {
            if (container != null)
                container.Dispose();

            container = null;
        }
开发者ID:ArthurYiL,项目名称:Vulcan.AspNetMvc,代码行数:7,代码来源:StructureMapDependencyScope.cs

示例14: RegisterContainer

		private void RegisterContainer() {
			var builder = new ContainerBuilder();
			builder.RegisterControllers(Assembly.GetExecutingAssembly());
			_pluginServicee.Startup(builder);
			_container = builder.Build();
			DependencyResolver.SetResolver(new AutofacDependencyResolver(_container));
		}
开发者ID:fengzijun,项目名称:MvcPluginByGriffin.mvccontrib,代码行数:7,代码来源:Global.asax.cs

示例15: Init

        public static void Init()
        {
            var serviceBusConnectionString = ConfigurationManager.ConnectionStrings["ServiceBus"].ConnectionString;
            var builder = new ContainerBuilder();
            var typeProvider = new AssemblyScanningTypeProvider(
                   Assembly.GetAssembly(typeof(ExampleEventHandler)),
                   Assembly.GetAssembly(typeof(ExampleCommand))
                   );

            var applicationName = Assembly.GetExecutingAssembly().ToNimbusName();
            var instanceName = Environment.MachineName;

            builder.RegisterNimbus(typeProvider);
            builder.RegisterType<NimbusLogger>().As<ILogger>();
            builder.Register(componetContext => new BusBuilder()
                .Configure()
                .WithConnectionString(serviceBusConnectionString)
                .WithNames(applicationName, instanceName)
                .WithTypesFrom(typeProvider)
                .WithDefaultTimeout(TimeSpan.FromSeconds(30))
                .WithAutofacDefaults(componetContext)
                .Build())
                .As<IBus>()
                .AutoActivate()
                .OnActivated(o => o.Instance.Start())
                .SingleInstance();

            _container = builder.Build();
        }
开发者ID:WIBORI,项目名称:api-template,代码行数:29,代码来源:Program.cs


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