DCT.UI.CoreUI.StopAttacking C# (CSharp) Method

StopAttacking() private method

private StopAttacking ( bool timeroff ) : void
timeroff bool true if timer should be disabled
return void
        internal void StopAttacking(bool timeroff)
        {
            if (InvokeRequired)
            {
                Invoke(new StopAttackingHandler(StopAttacking), timeroff);
                return;
            }

            if (Globals.AttackOn || Globals.AttackMode)
            {
                Globals.AttackOn = false;
                ToggleAttack(false);

                if (timeroff && (MainPanel.UseCountdownTimer || MainPanel.UseHourTimer))
                {
                    MainPanel.UseCountdownTimer = false;
                    MainPanel.UseHourTimer = false;

                    if (tabs.SelectedIndex != TABINDEX_ATTACK)
                    {
                        Tabs.TabPages[TABINDEX_ATTACK].Text = "Attack (*)";
                    }
                }
            }
        }

Usage Example

Example #1
0
 private void Logout()
 {
     mUI.LogPanel.Log("Logging out...");
     mUI.StopAttacking(false);
     HttpSocket.DefaultInstance.Get("http://outwar.com/index.php?cmd=logout");
     HttpSocket.DefaultInstance.Cookie = null;
     mEngine.Accounts.Clear();
     lvAccounts.Items.Clear();
     btnLogin.Enabled   = true;
     btnLogout.Enabled  = false;
     btnRefresh.Enabled = false;
 }
CoreUI