private void ObtainAccount(bool blnIsSwitching)
        {
            if (Core.Game.IsRunning && !blnIsSwitching)
            {
                m_account = new Account(Reflection.GetBattleTag(), Hearthstone_Deck_Tracker.Helper.GetCurrentRegion().Result);
            }
            else
            {
                List <string> lstAccounts = GetAccountList();

                if (lstAccounts.Count == 1)
                {
                    m_account = Account.Parse(lstAccounts[0]);
                }
                else if (lstAccounts.Count > 1)
                {
                    AccountSelectorDialog accSelectorDialog = new AccountSelectorDialog(lstAccounts);

                    if (accSelectorDialog.ShowDialog().Value)
                    {
                        m_account = Account.Parse(accSelectorDialog.SelectedAccount);
                    }
                    else
                    {
                    }
                }
                else
                {
                    m_account = Account.Empty;
                }
            }

            Log.WriteLine($"Account: {m_account?.AccountString}", LogType.Debug);
        }
Beispiel #2
0
        private static void SelectAccount(bool blnIsSwitching)
        {
            if (Core.Game.IsRunning && !blnIsSwitching)
            {
                s_account = Account.Current;
            }
            else
            {
                Account[] vAccounts = GetAccounts();

                if (vAccounts.Length == 1)
                {
                    s_account = vAccounts[0];
                }
                else if (vAccounts.Length > 1)
                {
                    AccountSelectorDialog accSelectorDialog = new AccountSelectorDialog(vAccounts);

                    if (accSelectorDialog.ShowDialog().Value)
                    {
                        s_account = Account.Parse(accSelectorDialog.SelectedAccount);

                        Settings.LastSelectedAccount = s_account.AccountString;
                    }
                    else
                    {
                    }
                }
                else
                {
                    s_account = Account.Empty;
                }
            }

            Log.WriteLine($"Account: {s_account?.AccountString}", LogType.Debug);
        }