Changeset 7013 for trunk/sources/HeuristicLab.MainForm.WindowsForms
- Timestamp:
- 11/17/11 14:09:13 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/MainForms/MainForm.cs
r6935 r7013 23 23 using System.Collections.Generic; 24 24 using System.Linq; 25 using System.Reflection;26 25 using System.Windows.Forms; 27 26 using HeuristicLab.Common; … … 34 33 private int appStartingCursors; 35 34 private int waitingCursors; 36 private string title;37 35 38 36 protected MainForm() … … 177 175 } 178 176 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; 185 } 177 protected virtual void OnInitialized(EventArgs e) { } 178 179 public virtual void UpdateTitle() { } 186 180 187 181 private void FormActivated(object sender, EventArgs e) { … … 498 492 } 499 493 #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 }514 494 } 515 495 }
Note: See TracChangeset
for help on using the changeset viewer.