示例#1
0
        private void ExitApplication_EventHandler(object sender, EventArgs e)
        {
            try
            {
                if (CheckForOpenRequestDetails() == false)
                {
                    return;
                }

                log.Info("Logged out of DataMart Client.");
                foreach (NetWorkSetting ns in Configuration.Instance.NetworkSettingCollection.NetWorkSettings)
                {
                    if (ns.SftpClient != null)
                    {
                        ns.SftpClient.Dispose();
                    }
                }
                SystemTray.HideSystemTrayIcon();
                Application.DoEvents();
                Application.Exit();
            }
            catch (Exception ex)
            {
                log.Error(ex);
                MessageBox.Show(ex.Message, "Unexpected Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
示例#2
0
        protected override void OnClosed(EventArgs e)
        {
            base.OnClosed(e);
            SystemTray.HideSystemTrayIcon();

            _autoRefresh.CallDispose();
            _tabIcons.CallDispose();
        }
示例#3
0
        protected override void OnClosed(EventArgs e)
        {
            base.OnClosed(e);

            SystemTray.HideSystemTrayIcon();

            if (_networkRefreshList != null && _networkRefreshList.Any())
            {
                _networkRefreshList.ForEach(p => p.CallDispose());
                _networkRefreshList.Clear();
            }

            _tabIcons.CallDispose();
        }