本文整理汇总了C#中MainWindow.SelectLastUsedDeck方法的典型用法代码示例。如果您正苦于以下问题:C# MainWindow.SelectLastUsedDeck方法的具体用法?C# MainWindow.SelectLastUsedDeck怎么用?C# MainWindow.SelectLastUsedDeck使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MainWindow
的用法示例。
在下文中一共展示了MainWindow.SelectLastUsedDeck方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
public static void Initialize()
{
Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory);
var newUser = !Directory.Exists(Config.AppDataPath);
Config.Load();
Log.Initialize();
ConfigManager.Run();
LogConfigUpdater.Run().Forget();
LogConfigWatcher.Start();
Helper.UpdateAppTheme();
ThemeManager.Run();
var splashScreenWindow = new SplashScreenWindow();
splashScreenWindow.ShowConditional();
Game = new GameV2();
LoginType loginType;
var loggedIn = HearthStatsAPI.LoadCredentials();
if(!loggedIn && Config.Instance.ShowLoginDialog)
{
var loginWindow = new LoginWindow();
splashScreenWindow.Close();
loginWindow.ShowDialog();
if(loginWindow.LoginResult == LoginType.None)
{
Application.Current.Shutdown();
return;
}
loginType = loginWindow.LoginResult;
splashScreenWindow = new SplashScreenWindow();
splashScreenWindow.ShowConditional();
}
else
loginType = loggedIn ? LoginType.AutoLogin : LoginType.AutoGuest;
MainWindow = new MainWindow();
MainWindow.LoadConfigSettings();
if(Config.Instance.ReselectLastDeckUsed)
{
MainWindow.SelectLastUsedDeck();
Config.Instance.ReselectLastDeckUsed = false;
Config.Save();
}
MainWindow.Show();
splashScreenWindow.Close();
if(ConfigManager.UpdatedVersion != null)
{
Updater.Cleanup();
MainWindow.FlyoutUpdateNotes.IsOpen = true;
MainWindow.UpdateNotesControl.SetHighlight(ConfigManager.PreviousVersion);
MainWindow.UpdateNotesControl.LoadUpdateNotes();
}
NetDeck.CheckForChromeExtention();
DataIssueResolver.Run();
Helper.CopyReplayFiles();
BackupManager.Run();
if(Config.Instance.PlayerWindowOnStart)
Windows.PlayerWindow.Show();
if(Config.Instance.OpponentWindowOnStart)
Windows.OpponentWindow.Show();
if(Config.Instance.TimerWindowOnStartup)
Windows.TimerWindow.Show();
if(Config.Instance.HearthStatsSyncOnStart && HearthStatsAPI.IsLoggedIn)
HearthStatsManager.SyncAsync(background: true);
PluginManager.Instance.LoadPlugins();
MainWindow.Options.OptionsTrackerPlugins.Load();
PluginManager.Instance.StartUpdateAsync();
UpdateOverlayAsync();
if(Config.Instance.ShowCapturableOverlay)
{
Windows.CapturableOverlay = new CapturableOverlayWindow();
Windows.CapturableOverlay.Show();
}
if(LogConfigUpdater.LogConfigUpdateFailed)
MainWindow.ShowLogConfigUpdateFailedMessage().Forget();
else if(LogConfigUpdater.LogConfigUpdated && Game.IsRunning)
{
MainWindow.ShowMessageAsync("Hearthstone restart required", "The log.config file has been updated. HDT may not work properly until Hearthstone has been restarted.");
Overlay.ShowRestartRequiredWarning();
}
LogReaderManager.Start(Game).Forget();
NewsUpdater.UpdateAsync();
HotKeyManager.Load();
if(Helper.HearthstoneDirExists && Config.Instance.StartHearthstoneWithHDT && !Game.IsRunning)
Helper.StartHearthstoneAsync();
Initialized = true;
Influx.OnAppStart(Helper.GetCurrentVersion(), loginType, newUser);
}
示例2: Initialize
public static void Initialize()
{
Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory);
var newUser = !Directory.Exists(Config.AppDataPath);
Config.Load();
Log.Initialize();
ConfigManager.Run();
Helper.UpdateAppTheme();
var splashScreenWindow = new SplashScreenWindow();
splashScreenWindow.ShowConditional();
Game = new GameV2();
LoginType loginType;
var loggedIn = HearthStatsAPI.LoadCredentials();
if(!loggedIn && Config.Instance.ShowLoginDialog)
{
var loginWindow = new LoginWindow();
splashScreenWindow.Close();
loginWindow.ShowDialog();
if(loginWindow.LoginResult == LoginType.None)
{
Application.Current.Shutdown();
return;
}
loginType = loginWindow.LoginResult;
splashScreenWindow = new SplashScreenWindow();
splashScreenWindow.ShowConditional();
}
else
loginType = loggedIn ? LoginType.AutoLogin : LoginType.AutoGuest;
MainWindow = new MainWindow();
MainWindow.LoadConfigSettings();
if(Config.Instance.ReselectLastDeckUsed)
{
MainWindow.SelectLastUsedDeck();
Config.Instance.ReselectLastDeckUsed = false;
Config.Save();
}
MainWindow.Show();
splashScreenWindow.Close();
if(ConfigManager.UpdatedVersion != null)
{
Updater.Cleanup();
MainWindow.FlyoutUpdateNotes.IsOpen = true;
MainWindow.UpdateNotesControl.LoadUpdateNotes();
}
NetDeck.CheckForChromeExtention();
DataIssueResolver.Run();
if(Helper.HearthstoneDirExists)
{
if(ConfigManager.LogConfigUpdateFailed)
MainWindow.ShowLogConfigUpdateFailedMessage().Forget();
else if(ConfigManager.LogConfigUpdated && Game.IsRunning)
{
MainWindow.ShowMessageAsync("Restart Hearthstone",
"This is either your first time starting HDT or the log.config file has been updated. Please restart Hearthstone, for HDT to work properly.");
}
LogReaderManager.Start(Game);
}
else
MainWindow.ShowHsNotInstalledMessage().Forget();
Helper.CopyReplayFiles();
BackupManager.Run();
if(Config.Instance.PlayerWindowOnStart)
Windows.PlayerWindow.Show();
if(Config.Instance.OpponentWindowOnStart)
Windows.OpponentWindow.Show();
if(Config.Instance.TimerWindowOnStartup)
Windows.TimerWindow.Show();
if(Config.Instance.HearthStatsSyncOnStart && HearthStatsAPI.IsLoggedIn)
HearthStatsManager.SyncAsync(background: true);
PluginManager.Instance.LoadPlugins();
MainWindow.Options.OptionsTrackerPlugins.Load();
PluginManager.Instance.StartUpdateAsync();
UpdateOverlayAsync();
NewsUpdater.UpdateAsync();
HotKeyManager.Load();
Initialized = true;
Analytics.Analytics.TrackPageView($"/app/v{Helper.GetCurrentVersion().ToVersionString()}/{loginType.ToString().ToLower()}{(newUser ? "/new" : "")}", "");
}