Free cookie consent management tool by TermsFeed Policy Generator

Changeset 11142 for stable


Ignore:
Timestamp:
07/08/14 18:56:29 (10 years ago)
Author:
mkommend
Message:

#2198: Merged r11012 into stable.

Location:
stable
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • stable

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

    r9933 r11142  
    2525using System.Windows.Forms;
    2626using HeuristicLab.Common;
     27using HeuristicLab.Core;
    2728using HeuristicLab.MainForm;
    2829using HeuristicLab.PluginInfrastructure;
     
    120121          saveFileDialog.FilterIndex = 2;
    121122        }
    122         saveFileDialog.FileName = string.IsNullOrEmpty(content.Filename) ? "Item" : content.Filename;
     123
     124        INamedItem namedItem = content as INamedItem;
     125        string suggestedFileName = string.Empty;
     126        if (!string.IsNullOrEmpty(content.Filename)) suggestedFileName = content.Filename;
     127        else if (namedItem != null) suggestedFileName = namedItem.Name;
     128        else suggestedFileName = "Item";
     129
     130        saveFileDialog.FileName = suggestedFileName;
    123131
    124132        if (saveFileDialog.ShowDialog() == DialogResult.OK) {
Note: See TracChangeset for help on using the changeset viewer.