private void NotifyIcon_Click(object sender, System.EventArgs e) { ExtensionView window = Application.Current.Windows.OfType <ExtensionView>().FirstOrDefault(); System.Windows.Forms.NotifyIcon icon = (System.Windows.Forms.NotifyIcon)sender; window.Show(); icon.Visible = false; }
//Выполняется вход в приложение private void Enter() { _status = NirsSystem.Authorization(Login, Password, true); OnPropertyChanged("Status"); OnPropertyChanged("StatusColor"); if (_status != AuthorizationStatus.AuthOK) { return; } try { ExtensionView extensionView = new ExtensionView(NirsSystem.OpenUserSettings()); extensionView.Show(); } catch (NirsException exception) { NirsSystem.ErrorManager.ExecuteException(exception); } finally { MainWindow window = Application.Current.Windows.OfType <MainWindow>().FirstOrDefault(); window.Close(); } }