本文整理汇总了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>();
}
示例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>();
}
示例3: Configure
protected override void Configure()
{
ViewModelLocator.AddNamespaceMapping(typeof(AppDelegate).Namespace, typeof(LoginViewModel).Namespace);
container = new SimpleContainer();
container.PerRequest<LoginViewModel>();
container.PerRequest<TableViewModel>();
}
示例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>();
}
示例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>();
}
示例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));
}
示例7: Configure
protected override void Configure() {
container = new SimpleContainer();
container.Singleton<IWindowManager, WindowManager>();
container.Singleton<IEventAggregator, EventAggregator>();
container.PerRequest<ILogInPageViewModel, LogInPageViewModel>();
}
示例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>();
}
示例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>();
}
示例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>();
}
示例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>();
}
示例12: SetUp
public void SetUp()
{
theContainer = new SimpleContainer();
theContainer.PerRequest<ILog, NullLog>();
IoC.BuildUp = theContainer.BuildUp;
IoC.GetInstance = theContainer.GetInstance;
IoC.GetAllInstances = theContainer.GetAllInstances;
}
示例13: Configure
protected override void Configure()
{
ViewModelLocator.AddNamespaceMapping("Hello.Xamarin.iOS", "Hello.Xamarin.Core.ViewModels");
container = new SimpleContainer();
container
.PerRequest<LoginViewModel>();
}
示例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);
}
示例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();
}