private void MainFormClosing_Handler(object sender, FormClosingEventArgs e) { ViewCloseRequest request = new ViewCloseRequest(); this.FormCloseRequested?.Invoke(request); e.Cancel = !request.Allow; }
private void Close(ViewCloseRequest request) { if (this._exitApplication || !this.View.MinimizeToTray) { this._thumbnailManager.Deactivate(); this._configurationStorage.Save(); request.Allow = true; return; } request.Allow = false; this.View.Minimize(); }