Free cookie consent management tool by TermsFeed Policy Generator

Changeset 6935


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

Location:
trunk/sources
Files:
5 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}
  • trunk/sources/HeuristicLab.Optimizer/3.3/FileManager.cs

    r6827 r6935  
    131131        SetEnabledStateOfContentViews(content, true);
    132132        if (error != null) throw error;
    133         MainFormManager.GetMainForm<OptimizerDockingMainForm>().UpdateTitle();
     133        MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().UpdateTitle();
    134134      }
    135135      catch (Exception ex) {
     
    142142
    143143    private static void SetEnabledStateOfContentViews(IStorableContent content, bool enabled) {
    144       OptimizerDockingMainForm mainForm = MainFormManager.GetMainForm<OptimizerDockingMainForm>();
     144      HeuristicLab.MainForm.WindowsForms.MainForm mainForm = MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>();
    145145      if (mainForm.InvokeRequired)
    146146        mainForm.Invoke((Action<IStorableContent, bool>)SetEnabledStateOfContentViews, content, enabled);
  • trunk/sources/HeuristicLab.Optimizer/3.3/OptimizerDockingMainForm.cs

    r6827 r6935  
    2323using System.ComponentModel;
    2424using System.Linq;
    25 using System.Reflection;
    2625using System.Windows.Forms;
    2726using HeuristicLab.Common;
     
    3332namespace HeuristicLab.Optimizer {
    3433  internal partial class OptimizerDockingMainForm : DockingMainForm {
    35     private string title;
    3634
    3735    private Clipboard<IItem> clipboard;
     
    5553    protected override void OnInitialized(EventArgs e) {
    5654      base.OnInitialized(e);
    57       AssemblyFileVersionAttribute version = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyFileVersionAttribute), true).
    58                                              Cast<AssemblyFileVersionAttribute>().FirstOrDefault();
    59       title = "HeuristicLab Optimizer";
    60       if (version != null) title += " " + version.Version;
    61       Title = title;
    6255
    6356      ContentManager.Initialize(new PersistenceContentManager());
     
    10396      UpdateTitle();
    10497    }
    105 
    106     public void UpdateTitle() {
    107       if (InvokeRequired)
    108         Invoke(new Action(UpdateTitle));
    109       else {
    110         IContentView activeView = ActiveView as IContentView;
    111         if ((activeView != null) && (activeView.Content != null) && (activeView.Content is IStorableContent)) {
    112           IStorableContent content = (IStorableContent)activeView.Content;
    113           Title = title + " [" + (string.IsNullOrEmpty(content.Filename) ? "Unsaved" : content.Filename) + "]";
    114         } else {
    115           Title = title;
    116         }
    117       }
    118     }
    11998  }
    12099}
  • trunk/sources/HeuristicLab.Optimizer/3.3/OptimizerMultipleDocumentMainForm.cs

    r6827 r6935  
    2323using System.ComponentModel;
    2424using System.Linq;
    25 using System.Reflection;
    2625using System.Windows.Forms;
    2726using HeuristicLab.Common;
     
    3332namespace HeuristicLab.Optimizer {
    3433  internal partial class OptimizerMultipleDocumentMainForm : MultipleDocumentMainForm {
    35     private string title;
    3634
    3735    private Clipboard<IItem> clipboard;
     
    5553    protected override void OnInitialized(EventArgs e) {
    5654      base.OnInitialized(e);
    57       AssemblyFileVersionAttribute version = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyFileVersionAttribute), true).
    58                                              Cast<AssemblyFileVersionAttribute>().FirstOrDefault();
    59       title = "HeuristicLab Optimizer";
    60       if (version != null) title += " " + version.Version;
    61       Title = title;
    6255
    6356      ContentManager.Initialize(new PersistenceContentManager());
     
    10396      UpdateTitle();
    10497    }
    105 
    106     public void UpdateTitle() {
    107       if (InvokeRequired)
    108         Invoke(new Action(UpdateTitle));
    109       else {
    110         IContentView activeView = ActiveView as IContentView;
    111         if ((activeView != null) && (activeView.Content != null) && (activeView.Content is IStorableContent)) {
    112           IStorableContent content = (IStorableContent)activeView.Content;
    113           Title = title + " [" + (string.IsNullOrEmpty(content.Filename) ? "Unsaved" : content.Filename) + "]";
    114         } else {
    115           Title = title;
    116         }
    117       }
    118     }
    11998  }
    12099}
  • trunk/sources/HeuristicLab.Optimizer/3.3/OptimizerSingleDocumentMainForm.cs

    r6827 r6935  
    2323using System.ComponentModel;
    2424using System.Linq;
    25 using System.Reflection;
    2625using System.Windows.Forms;
    2726using HeuristicLab.Common;
     
    3332namespace HeuristicLab.Optimizer {
    3433  internal partial class OptimizerSingleDocumentMainForm : SingleDocumentMainForm {
    35     private string title;
    3634
    3735    private Clipboard<IItem> clipboard;
     
    5553    protected override void OnInitialized(EventArgs e) {
    5654      base.OnInitialized(e);
    57       AssemblyFileVersionAttribute version = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyFileVersionAttribute), true).
    58                                              Cast<AssemblyFileVersionAttribute>().FirstOrDefault();
    59       title = "HeuristicLab Optimizer";
    60       if (version != null) title += " " + version.Version;
    61       Title = title;
    6255
    6356      ContentManager.Initialize(new PersistenceContentManager());
     
    10396      UpdateTitle();
    10497    }
    105 
    106     public void UpdateTitle() {
    107       if (InvokeRequired)
    108         Invoke(new Action(UpdateTitle));
    109       else {
    110         IContentView activeView = ActiveView as IContentView;
    111         if ((activeView != null) && (activeView.Content != null) && (activeView.Content is IStorableContent)) {
    112           IStorableContent content = (IStorableContent)activeView.Content;
    113           Title = title + " [" + (string.IsNullOrEmpty(content.Filename) ? "Unsaved" : content.Filename) + "]";
    114         } else {
    115           Title = title;
    116         }
    117       }
    118     }
    11998  }
    12099}
Note: See TracChangeset for help on using the changeset viewer.