Changeset 10498 for trunk/sources/HeuristicLab.Optimizer
- Timestamp:
- 02/21/14 14:14:47 (11 years ago)
- Location:
- trunk/sources/HeuristicLab.Optimizer/3.3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Optimizer/3.3/OptimizerDockingMainForm.cs
r9456 r10498 86 86 protected override void OnClosing(CancelEventArgs e) { 87 87 base.OnClosing(e); 88 if (MainFormManager.MainForm.Views.OfType<IContentView>(). FirstOrDefault() != null) {88 if (MainFormManager.MainForm.Views.OfType<IContentView>().Any(v=>v.Content is IStorableContent)) { 89 89 if (MessageBox.Show(this, "Some views are still opened. If their content has not been saved, it will be lost after closing. Do you really want to close HeuristicLab Optimizer?", "Close Optimizer", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.No) 90 90 e.Cancel = true; … … 110 110 else { 111 111 IContentView activeView = ActiveView as IContentView; 112 if ((activeView != null) && (activeView.Content != null) && (activeView.Contentis IStorableContent)) {112 if ((activeView != null) && (activeView.Content is IStorableContent)) { 113 113 IStorableContent content = (IStorableContent)activeView.Content; 114 114 Title = title + " [" + (string.IsNullOrEmpty(content.Filename) ? "Unsaved" : content.Filename) + "]"; -
trunk/sources/HeuristicLab.Optimizer/3.3/OptimizerMultipleDocumentMainForm.cs
r9456 r10498 86 86 protected override void OnClosing(CancelEventArgs e) { 87 87 base.OnClosing(e); 88 if (MainFormManager.MainForm.Views.OfType<IContentView>(). FirstOrDefault() != null) {88 if (MainFormManager.MainForm.Views.OfType<IContentView>().Any(v => v.Content is IStorableContent)) { 89 89 if (MessageBox.Show(this, "Some views are still opened. If their content has not been saved, it will be lost after closing. Do you really want to close HeuristicLab Optimizer?", "Close Optimizer", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.No) 90 90 e.Cancel = true; … … 110 110 else { 111 111 IContentView activeView = ActiveView as IContentView; 112 if ((activeView != null) && (activeView.Content != null) && (activeView.Contentis IStorableContent)) {112 if ((activeView != null) && (activeView.Content is IStorableContent)) { 113 113 IStorableContent content = (IStorableContent)activeView.Content; 114 114 Title = title + " [" + (string.IsNullOrEmpty(content.Filename) ? "Unsaved" : content.Filename) + "]"; -
trunk/sources/HeuristicLab.Optimizer/3.3/OptimizerSingleDocumentMainForm.cs
r9456 r10498 86 86 protected override void OnClosing(CancelEventArgs e) { 87 87 base.OnClosing(e); 88 if (MainFormManager.MainForm.Views.OfType<IContentView>(). FirstOrDefault() != null) {88 if (MainFormManager.MainForm.Views.OfType<IContentView>().Any(v => v.Content is IStorableContent)) { 89 89 if (MessageBox.Show(this, "Some views are still opened. If their content has not been saved, it will be lost after closing. Do you really want to close HeuristicLab Optimizer?", "Close Optimizer", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.No) 90 90 e.Cancel = true; … … 110 110 else { 111 111 IContentView activeView = ActiveView as IContentView; 112 if ((activeView != null) && (activeView.Content != null) && (activeView.Contentis IStorableContent)) {112 if ((activeView != null) && (activeView.Content is IStorableContent)) { 113 113 IStorableContent content = (IStorableContent)activeView.Content; 114 114 Title = title + " [" + (string.IsNullOrEmpty(content.Filename) ? "Unsaved" : content.Filename) + "]";
Note: See TracChangeset
for help on using the changeset viewer.