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


C# SimpleContainer.PerRequest方法代码示例

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


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

示例1: Configure

        protected override void Configure()
        {
            container = new SimpleContainer();

            container.Singleton<IWindowManager, WindowManager>();
            container.Singleton<IEventAggregator, EventAggregator>();
            container.PerRequest<IShell, ShellViewModel>();
            container.PerRequest<IMyScreen, MyScreenViewModel>();
        }
开发者ID:P2P2,项目名称:CmScreens,代码行数:9,代码来源:AppBootstrapper.cs

示例2: Configure

        protected override void Configure() {
            container = new SimpleContainer();
            
            container.Singleton<IWindowManager, WindowManager>();
            container.Singleton<IEventAggregator, EventAggregator>();
            container.PerRequest<IShellViewModel, ShellViewModel>();

            container.PerRequest<ViewModels.IAllArtistsViewModel, ViewModels.AllArtistsViewModel>();
        }
开发者ID:ibebbs,项目名称:OneCog.Io.Plex,代码行数:9,代码来源:AppBootstrapper.cs

示例3: Configure

        protected override void Configure()
        {
            ViewModelLocator.AddNamespaceMapping(typeof(AppDelegate).Namespace, typeof(LoginViewModel).Namespace);

            container = new SimpleContainer();

            container.PerRequest<LoginViewModel>();
            container.PerRequest<TableViewModel>();
        }
开发者ID:Kymeric,项目名称:Caliburn.Micro.Mobile,代码行数:9,代码来源:AppDelegate.cs

示例4: Configure

        protected override void Configure()
        {
            _container = new SimpleContainer();
            _container.Instance(_container);
            _container.Singleton<IWindowManager, WindowManager>();
            _container.Singleton<IEventAggregator, EventAggregator>();

            _container.Singleton<IUIManager, UIManager>();
            _container.Singleton<IEventDispatcher, EventDispatcher>();

            _container.Singleton<TextBlockViewManager>();
            _container.Singleton<ButtonViewManager>();
            _container.Singleton<ContainerViewManager>();
            _container.Singleton<StackPanelViewManager>();

            _container.Instance<IReactAssemblyProvider>(new ReactAssemblyProvider(SelectAssemblies));

            //            _container.PerRequest<IJavaScriptExecutor, JavaScriptCoreExecutor>();
            _container.PerRequest<IJavaScriptExecutor, WebSocketExecutor>();
            _container.Singleton<IReactBridge, ReactBridgeImpl>();
            _container.PerRequest<IModuleLoader, ModuleLoader>();
            _container.PerRequest<ReactRootViewModel>();
            _container.PerRequest<ReactTextBlockViewModel>();
            _container.PerRequest<ReactButtonViewModel>();
            _container.PerRequest<ReactContainerViewModel>();

            _container.PerRequest<IShell, ShellViewModel>();
            _container.PerRequest<CefSampleViewModel>();
            _container.PerRequest<WebSocketSampleViewModel>();
        }
开发者ID:joemcbride,项目名称:react-native-wpf,代码行数:30,代码来源:SampleAppBootstrapper.cs

示例5: Configure

        protected override void Configure()
        {
            container = new SimpleContainer();

            container.Singleton<IWindowManager, WindowManager>();
            container.Singleton<IEventAggregator, EventAggregator>();
            container.PerRequest<IShell, MainViewModel>();
            container.PerRequest<IScreen, FieldsViewModel>();
            container.PerRequest<IScreen, ServicesViewModel>();
            container.PerRequest<IScreen, CommissionsViewModel>();
        }
开发者ID:TheBorusik,项目名称:OperatorCreator,代码行数:11,代码来源:AppBootstrapper.cs

示例6: The_child_container_returned_contains_parent_entries

        public void The_child_container_returned_contains_parent_entries() {
            var container = new SimpleContainer();
            container.PerRequest<object>();
            var childContainer = container.CreateChildContainer();

            Assert.NotNull(childContainer.GetInstance(typeof (object), null));
        }
开发者ID:haoasqui,项目名称:Caliburn.Micro,代码行数:7,代码来源:SimpleContainerTests.cs

示例7: Configure

        protected override void Configure() {
            container = new SimpleContainer();

            container.Singleton<IWindowManager, WindowManager>();
            container.Singleton<IEventAggregator, EventAggregator>();
            container.PerRequest<ILogInPageViewModel, LogInPageViewModel>();
        }
开发者ID:ibebbs,项目名称:Blog.ReactiveBehaviors,代码行数:7,代码来源:AppBootstrapper.cs

示例8: Configure

		protected override void Configure()
		{
			container = new SimpleContainer();

            container.Instance(container);
			
            container.Singleton<IWindowManager, WindowManager>();
			container.Singleton<IEventAggregator, EventAggregator>();
            container.Singleton<IIndexService, IndexService>();
            
            container.PerRequest<ShellViewModel>();
            container.PerRequest<OverviewViewModel>();

            container.PerRequest<IFolderBrowser, FolderBrowser>();
            container.PerRequest<IMessageBox, Luke.Net.Lib.UI.MessageBox>();
		}
开发者ID:paulirwin,项目名称:Luke.Net,代码行数:16,代码来源:AppBootstrapper.cs

示例9: Application

        public Application(SimpleContainer container)
        {
            this.container = container;

            Initialize();

            ViewModelLocator.AddNamespaceMapping("NDC.Build.Forms.Core.Views", "NDC.Build.Core.ViewModels");
            ViewLocator.AddNamespaceMapping("NDC.Build.Core.ViewModels", "NDC.Build.Forms.Core.Views");

            MessageBinder.SpecialValues.Add("$tappedItem", GetTappedItem);

            container.Instance<FormsApplication>(this);

            container
               .Singleton<ITeamServicesClient, OfflineTeamServicesClient>()
               .Singleton<IAuthenticationService, OfflineAuthenticationService>()
               .Singleton<IApplicationNavigationService, ApplicationNavigationService>()
               .Singleton<IDialogService, ActionSheetDialogService>();

            container
                .PerRequest<LoginViewModel>()
                .PerRequest<ProjectsViewModel>()
                .PerRequest<BuildsViewModel>();

            DisplayRootView<LoginView>();
        }
开发者ID:nigel-sampson,项目名称:talks,代码行数:26,代码来源:Application.cs

示例10: Application

        public Application(SimpleContainer container)
        {
            this.container = container;

            ConventionManager.AddElementConvention<SearchBar>(SearchBar.TextProperty, "Text", "SearchButtonPressed");

            ViewModelLocator.AddNamespaceMapping("Hubb.Forms.Core.Views", "Hubb.Core.ViewModels");
            ViewLocator.AddNamespaceMapping("Hubb.Core.ViewModels", "Hubb.Forms.Core.Views");

            Initialize();

            container
                .Instance<IGitHubClient>(new GitHubClient(new ProductHeaderValue("hubb-forms", "1.0.0")));

            container
                .Singleton<IAuthenticationService, AuthenticationService>()
                .Singleton<IRepositoryService, RepositoryService>()
                .Singleton<IAppNavigationService, AppNavigationService>();

            container
                .PerRequest<LoginViewModel>()
                .PerRequest<RepositorySearchViewModel>();

            DisplayRootView<LoginView>();
        }
开发者ID:nigel-sampson,项目名称:talks,代码行数:25,代码来源:Application.cs

示例11: Configure

        protected override void Configure()
        {
            _container = new SimpleContainer();

            _container.Singleton<IWindowManager, WindowManager>();
            _container.Singleton<IEventAggregator, EventAggregator>();
            _container.PerRequest<IShell, ShellViewModel>();
            _container.PerRequest<MainViewModel>();
            _container.PerRequest<WidgetViewModel>();
            _container.PerRequest<SettingViewModel>();
            _container.PerRequest<Widget2ViewModel>();
            _container.PerRequest<SiteRealtimeViewModel>();
            _container.PerRequest<SponsorViewModel>();
            _container.PerRequest<TrackAnalysisReportViewModel>();
            _container.PerRequest<TrackRealtimeViewModel>();
            _container.PerRequest<BenchmarkViewModel>();
        }
开发者ID:heyixiaoran,项目名称:BoardClient,代码行数:17,代码来源:AppBootstrapper.cs

示例12: SetUp

        public void SetUp()
        {
            theContainer = new SimpleContainer();
            theContainer.PerRequest<ILog, NullLog>();

            IoC.BuildUp = theContainer.BuildUp;
            IoC.GetInstance = theContainer.GetInstance;
            IoC.GetAllInstances = theContainer.GetAllInstances;
        }
开发者ID:joemcbride,项目名称:outlander,代码行数:9,代码来源:IoCTester.cs

示例13: Configure

        protected override void Configure()
        {
            ViewModelLocator.AddNamespaceMapping("Hello.Xamarin.iOS", "Hello.Xamarin.Core.ViewModels");

            container = new SimpleContainer();

            container
                .PerRequest<LoginViewModel>();
        }
开发者ID:CrazyBBer,项目名称:Caliburn.Micro.Learn,代码行数:9,代码来源:AppDelegate.cs

示例14: Instances_registered_PerRequest_returns_a_different_instance_for_each_call

        public void Instances_registered_PerRequest_returns_a_different_instance_for_each_call() {
            var container = new SimpleContainer();
            container.PerRequest<object>();

            var instanceA = container.GetInstance(typeof (object), null);
            var instanceB = container.GetInstance(typeof (object), null);

            Assert.NotSame(instanceA, instanceB);
        }
开发者ID:haoasqui,项目名称:Caliburn.Micro,代码行数:9,代码来源:SimpleContainerTests.cs

示例15: ConfigureContainer

        private void ConfigureContainer()
        {
            _container = new SimpleContainer();

            var appSettings = new AppSettings();

            var services = new ServiceLocator(_container);

            _container.Instance<AppSettings>(appSettings);
            _container.Singleton<IFileSystem, FileSystem>();
            _container.Singleton<IDirectorySystem, DirectorySystem>();
            _container.Instance<IServiceLocator>(services);
            _container.PerRequest<IAsyncSocket, AsyncSocket>();
            _container.PerRequest<IAuthenticationServer, AuthenticationServer>();
            _container.Singleton<IGameParser, NewGameParser>();
            _container.Singleton<IGameState, SimpleGameState>();
            _container.Singleton<IGameServer, SimpleGameServer>();
            _container.Singleton<IScriptLoader, ScriptLoader>();
            _container.Singleton<IScriptRunner, ScriptRunner>();
            _container.Singleton<IRoundtimeHandler, RoundtimeHandler>();
            _container.Singleton<WaitForTokenHandler>();
            _container.Singleton<WaitForReTokenHandler>();
            _container.Singleton<MatchWaitTokenHandler>();

            _container.PerRequest<ITagTransformer, ComponentTagTransformer>();
            _container.PerRequest<ITagTransformer, StreamWindowTagTransformer>();

            _container.PerRequest<IIfBlockExecuter, IfBlockExecuter>();
            _container.Singleton<IIfBlocksParser, IfBlocksParser>();

            _container.PerRequest<IScript, Script>();
            _container.Singleton<IScriptLog, ScriptLog>();

            _container.PerRequest<IVariableReplacer, VariableReplacer>();
            _container.Singleton<ICommandProcessor, CommandProcessor>();

            _container.Singleton<IGameStream, GameStream>();

            _container.Singleton<ISendQueue, SendQueue>();

            _container.Singleton<IConfigLoader, ConfigLoader>();
            _container.Singleton<IVariablesLoader, VariablesLoader>();
            _container.Singleton<IHighlightsLoader, HighlightsLoader>();
            _container.Singleton<IAppDirectoriesBuilder, AppDirectoriesBuilder>();
            _container.Singleton<IAppSettingsLoader, AppSettingsLoader>();
            _container.Singleton<IProfileLoader, ProfileLoader>();

            var now = DateTime.Now.ToString("s");
            var logFileName = string.Format("{0}-log.txt", now);
            var errorsFileName = string.Format("{0}-errors.txt", now);

            var logger = new SimpleFileLogger(logFileName, errorsFileName, services);

            var compositeLog = new CompositeLog(new ILog[]{ logger });

            _container.Instance<ILog>(compositeLog);

            SetupHighlights();
        }
开发者ID:joemcbride,项目名称:outlander,代码行数:59,代码来源:Bootstrapper.cs


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