Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/21/10 05:10:12 (15 years ago)
Author:
swagner
Message:

Continued work on adapting and refactoring HeuristicLab.Data according to the changes in HeuristicLab.Core (#95)

File:
1 edited

Legend:

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

    r2656 r2665  
    5353      if (newItemDialog.ShowDialog() == DialogResult.OK) {
    5454        IView view = MainFormManager.CreateDefaultView(newItemDialog.Item);
    55         if (view is IObjectView) {
    56           view.Caption = "Item" + newDocumentsCounter.ToString() + ".hl";
    57           newDocumentsCounter++;
     55        if (view == null) {
     56          MessageBox.Show("There is no view for the new item. It cannot be displayed. ", "No View Available", MessageBoxButtons.OK, MessageBoxIcon.Error);
     57        } else {
     58          if (view is IObjectView) {
     59            view.Caption = "Item" + newDocumentsCounter.ToString() + ".hl";
     60            newDocumentsCounter++;
     61          }
     62          MainFormManager.MainForm.ShowView(view);
    5863        }
    59         MainFormManager.MainForm.ShowView(view);
    6064      }
    6165    }
     
    188192              Invoke(delegate() {
    189193                IObjectView view = MainFormManager.CreateDefaultView(item) as IObjectView;
    190                 if (view != null) {
     194                if (view == null) {
     195                  MessageBox.Show("There is no view for the loaded item. It cannot be displayed. ", "No View Available", MessageBoxButtons.OK, MessageBoxIcon.Error);
     196                } else {
    191197                  view.Caption = Path.GetFileName(filename);
    192198                  files.Add(view, new FileInfo(filename));
Note: See TracChangeset for help on using the changeset viewer.