本文整理汇总了C#中IContainer.ApplyPerfCounterTracker方法的典型用法代码示例。如果您正苦于以下问题:C# IContainer.ApplyPerfCounterTracker方法的具体用法?C# IContainer.ApplyPerfCounterTracker怎么用?C# IContainer.ApplyPerfCounterTracker使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IContainer
的用法示例。
在下文中一共展示了IContainer.ApplyPerfCounterTracker方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitializeClient
// Move to another method to avoid loading Zetbox.Objects
private void InitializeClient(string[] args, ZetboxConfig config)
{
InitializeSplashScreenImageResource();
StartupScreen.ShowSplashScreen(Zetbox.Client.Properties.Resources.Startup_Message, Zetbox.Client.Properties.Resources.Startup_InitApp, 6, config);
if (config.Server != null && config.Server.StartServer)
{
StartupScreen.SetInfo(Zetbox.Client.Properties.Resources.Startup_Server);
serverDomain = new ServerDomainManager();
serverDomain.Start(config);
}
var builder = Zetbox.API.Utils.AutoFacBuilder.CreateContainerBuilder(config, config.Client.Modules);
ConfigureContainerBuilder(config, builder);
container = builder.Build();
container.ApplyPerfCounterTracker();
container.Resolve<IUIExceptionReporter>().BeginInit();
API.AppDomainInitializer.InitializeFrom(container);
StartupScreen.SetInfo(Zetbox.Client.Properties.Resources.Startup_Launcher);
LoadStyles(this.Resources);
// Focus nightmare
// http://stackoverflow.com/questions/673536/wpf-cant-set-focus-to-a-child-of-usercontrol/4785124#4785124
EventManager.RegisterClassHandler(typeof(Window), Window.LoadedEvent, new RoutedEventHandler(FocusFixLoaded));
EventManager.RegisterClassHandler(typeof(Zetbox.Client.WPF.View.ZetboxBase.InstanceCollectionBase), UserControl.LoadedEvent, new RoutedEventHandler(FocusFixLoaded));
// Init credentials explicit
StartupScreen.SetInfo(Zetbox.Client.Properties.Resources.Startup_EnsuringCredentials);
var principalResolver = container.Resolve<IPrincipalResolver>();
var credResolver = container.Resolve<ICredentialsResolver>();
try
{
while (principalResolver.GetCurrent() == null)
{
credResolver.InvalidCredentials();
}
}
catch (AuthenticationException)
{
ReportExceptionAndExit(WpfToolkitResources.App_InvalidCredentials_Caption, WpfToolkitResources.App_InvalidCredentials);
}
catch (InvalidZetboxGeneratedVersionException)
{
ReportExceptionAndExit(WpfToolkitResources.App_InvalidZetboxGeneratedVersion_Caption, WpfToolkitResources.App_InvalidZetboxGeneratedVersion);
}
credResolver.Freeze();
StartupScreen.SetInfo(Zetbox.Client.Properties.Resources.Startup_Launcher);
container.Resolve<IUIExceptionReporter>().EndInit();
FixupDatabase(container.Resolve<Func<IZetboxContext>>());
IServiceControlManager scm = null;
if (container.TryResolve<IServiceControlManager>(out scm))
{
Logging.Log.Info("Starting Zetbox Services");
scm.Start();
}
else
{
Logging.Log.Info("Service control manager not registered");
}
StartupScreen.CanCloseOnWindowLoaded();
// delegate all business logic into another class, which
// allows us to load the Zetbox.Objects assemblies _before_
// they are needed.
var launcher = container.Resolve<Launcher>();
launcher.Show(args);
}