Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/25/16 17:58:07 (8 years ago)
Author:
mkommend
Message:

#2567: Implemented saving and restoring the window position, size and state of the optimizer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimizer/3.3/Plugin.cs.frame

    r13321 r13567  
    6060      }
    6161
    62       if (mainForm != null) {
     62      if (mainForm != null) {     
     63        mainForm.Location = Settings.Default.MainFormLocation;
     64        mainForm.Size = Settings.Default.MainFormSize;
     65        mainForm.Load += (sender, eventArgs) => {
     66          mainForm.WindowState = Settings.Default.MainFormWindowState;
     67        };
     68
     69        mainForm.FormClosing += (sender, eventArgs) => {
     70          Settings.Default.MainFormWindowState = mainForm.WindowState;
     71          if (mainForm.WindowState != FormWindowState.Normal) {
     72            Settings.Default.MainFormLocation = mainForm.RestoreBounds.Location;
     73            Settings.Default.MainFormSize = mainForm.RestoreBounds.Size;
     74          } else if (mainForm.WindowState == FormWindowState.Normal) {
     75            Settings.Default.MainFormLocation = mainForm.Location;
     76            Settings.Default.MainFormSize = mainForm.Size;
     77          }
     78        };
     79
     80
    6381        ClientInformation.InitializeAsync();
    6482        UserInformation.InitializeAsync();
Note: See TracChangeset for help on using the changeset viewer.