Changeset 3741


Ignore:
Timestamp:
05/10/10 15:25:51 (12 years ago)
Author:
swagner
Message:

Implemented reviewers' comments (#893)

  • added "Do you want to close Optimizer" dialog
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimizer/3.3/OptimizerMainForm.cs

    r3557 r3741  
    2121
    2222using System;
     23using System.ComponentModel;
    2324using System.Linq;
    2425using System.Reflection;
     
    8485    }
    8586
     87    protected override void OnClosing(CancelEventArgs e) {
     88      base.OnClosing(e);
     89      if (MainFormManager.MainForm.Views.OfType<IContentView>().FirstOrDefault() != null) {
     90        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)
     91          e.Cancel = true;
     92      }
     93    }
     94
    8695    protected override void OnActiveViewChanged() {
    8796      base.OnActiveViewChanged();
Note: See TracChangeset for help on using the changeset viewer.