- Timestamp:
- 02/04/16 13:28:04 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Starter/StarterForm.cs
r12012 r13586 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Drawing; 24 25 using System.IO; 25 26 using System.Linq; … … 29 30 using HeuristicLab.PluginInfrastructure.Advanced; 30 31 using HeuristicLab.PluginInfrastructure.Manager; 32 using HeuristicLab.PluginInfrastructure.Properties; 31 33 32 34 namespace HeuristicLab.PluginInfrastructure.Starter { … … 67 69 splashScreen.Show(this, "Loading HeuristicLab..."); 68 70 71 if (CheckSavedStarterFormSettings()) { 72 Location = Settings.Default.StarterFormLocation; 73 Size = Settings.Default.StarterFormSize; 74 WindowState = Settings.Default.StarterFormWindowState; 75 } 76 69 77 pluginManager.DiscoverAndCheckPlugins(); 70 78 UpdateApplicationsList(); … … 96 104 splashScreen.Close(); 97 105 abortRequested = true; 106 107 if (WindowState != FormWindowState.Minimized) 108 Settings.Default.StarterFormWindowState = WindowState; 109 if (WindowState != FormWindowState.Normal) { 110 Settings.Default.StarterFormLocation = RestoreBounds.Location; 111 Settings.Default.StarterFormSize = RestoreBounds.Size; 112 } else if (WindowState == FormWindowState.Normal) { 113 Settings.Default.StarterFormLocation = Location; 114 Settings.Default.StarterFormSize = Size; 115 } 116 117 Settings.Default.Save(); 98 118 } 99 119 … … 177 197 178 198 #region Helpers 199 private bool CheckSavedStarterFormSettings() { 200 var formArea = new Rectangle(Settings.Default.StarterFormLocation, Settings.Default.StarterFormSize); 201 var screenArea = Screen.FromRectangle(formArea).WorkingArea; 202 var overlappingArea = Rectangle.Intersect(formArea, screenArea); 203 bool offLimits = overlappingArea.IsEmpty || overlappingArea.Width * overlappingArea.Height < formArea.Width * formArea.Height * 0.25; 204 return !formArea.IsEmpty && !offLimits; 205 } 206 179 207 private void UpdateApplicationsList() { 180 208 if (InvokeRequired) Invoke((Action)UpdateApplicationsList);
Note: See TracChangeset
for help on using the changeset viewer.