Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/18/11 16:02:58 (13 years ago)
Author:
ascheibe
Message:

#1652 fixed a bug when saving a file in SD or MD mode

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/MainForms/MainForm.cs

    r6827 r6935  
    2323using System.Collections.Generic;
    2424using System.Linq;
     25using System.Reflection;
    2526using System.Windows.Forms;
    2627using HeuristicLab.Common;
     
    3334    private int appStartingCursors;
    3435    private int waitingCursors;
     36    private string title;
    3537
    3638    protected MainForm()
     
    176178
    177179    protected virtual void OnInitialized(EventArgs e) {
     180      AssemblyFileVersionAttribute version = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyFileVersionAttribute), true).
     181                                             Cast<AssemblyFileVersionAttribute>().FirstOrDefault();
     182      title = "HeuristicLab Optimizer";
     183      if (version != null) title += " " + version.Version;
     184      Title = title;
    178185    }
    179186
     
    491498    }
    492499    #endregion
     500
     501    public virtual void UpdateTitle() {
     502      if (InvokeRequired)
     503        Invoke(new Action(UpdateTitle));
     504      else {
     505        IContentView activeView = ActiveView as IContentView;
     506        if ((activeView != null) && (activeView.Content != null) && (activeView.Content is IStorableContent)) {
     507          IStorableContent content = (IStorableContent)activeView.Content;
     508          Title = title + " [" + (string.IsNullOrEmpty(content.Filename) ? "Unsaved" : content.Filename) + "]";
     509        } else {
     510          Title = title;
     511        }
     512      }
     513    }
    493514  }
    494515}
Note: See TracChangeset for help on using the changeset viewer.