Changeset 6935 for trunk/sources/HeuristicLab.MainForm.WindowsForms
- Timestamp:
- 10/18/11 16:02:58 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/MainForms/MainForm.cs
r6827 r6935 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using System.Reflection; 25 26 using System.Windows.Forms; 26 27 using HeuristicLab.Common; … … 33 34 private int appStartingCursors; 34 35 private int waitingCursors; 36 private string title; 35 37 36 38 protected MainForm() … … 176 178 177 179 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; 178 185 } 179 186 … … 491 498 } 492 499 #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 } 493 514 } 494 515 }
Note: See TracChangeset
for help on using the changeset viewer.