Free cookie consent management tool by TermsFeed Policy Generator

Changeset 10893


Ignore:
Timestamp:
05/27/14 08:35:48 (10 years ago)
Author:
gkronber
Message:

#2104 merged r10498 from trunk to stable

Location:
stable
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Optimizer/3.3/OptimizerDockingMainForm.cs

    r9456 r10893  
    8686    protected override void OnClosing(CancelEventArgs e) {
    8787      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)) {
    8989        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)
    9090          e.Cancel = true;
     
    110110      else {
    111111        IContentView activeView = ActiveView as IContentView;
    112         if ((activeView != null) && (activeView.Content != null) && (activeView.Content is IStorableContent)) {
     112        if ((activeView != null) && (activeView.Content is IStorableContent)) {
    113113          IStorableContent content = (IStorableContent)activeView.Content;
    114114          Title = title + " [" + (string.IsNullOrEmpty(content.Filename) ? "Unsaved" : content.Filename) + "]";
  • stable/HeuristicLab.Optimizer/3.3/OptimizerMultipleDocumentMainForm.cs

    r9456 r10893  
    8686    protected override void OnClosing(CancelEventArgs e) {
    8787      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)) {
    8989        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)
    9090          e.Cancel = true;
     
    110110      else {
    111111        IContentView activeView = ActiveView as IContentView;
    112         if ((activeView != null) && (activeView.Content != null) && (activeView.Content is IStorableContent)) {
     112        if ((activeView != null) && (activeView.Content is IStorableContent)) {
    113113          IStorableContent content = (IStorableContent)activeView.Content;
    114114          Title = title + " [" + (string.IsNullOrEmpty(content.Filename) ? "Unsaved" : content.Filename) + "]";
  • stable/HeuristicLab.Optimizer/3.3/OptimizerSingleDocumentMainForm.cs

    r9456 r10893  
    8686    protected override void OnClosing(CancelEventArgs e) {
    8787      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)) {
    8989        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)
    9090          e.Cancel = true;
     
    110110      else {
    111111        IContentView activeView = ActiveView as IContentView;
    112         if ((activeView != null) && (activeView.Content != null) && (activeView.Content is IStorableContent)) {
     112        if ((activeView != null) && (activeView.Content is IStorableContent)) {
    113113          IStorableContent content = (IStorableContent)activeView.Content;
    114114          Title = title + " [" + (string.IsNullOrEmpty(content.Filename) ? "Unsaved" : content.Filename) + "]";
Note: See TracChangeset for help on using the changeset viewer.