private void disconnectMenu_Click(object sender, EventArgs e) { timerSetData.Stop(); P2P.Closing(); menuStrip.Items.Insert(menuStrip.Items.IndexOf(disconnectMenu), connectMenu); menuStrip.Items.Remove(disconnectMenu); refreshMenu.Enabled = false; }
protected override void OnFormClosing(FormClosingEventArgs e) { base.OnFormClosing(e); if (e.CloseReason == CloseReason.WindowsShutDown) { P2P.Closing(); return; } if (MessageBox.Show(string.Format(Resources.Home_OnFormClosing_, DlgSetting.UserName), @"Внимание", MessageBoxButtons.YesNo) != DialogResult.Yes) { e.Cancel = true; return; } P2P.Closing(); }