- Timestamp:
- 03/18/19 17:24:30 (6 years ago)
- Location:
- branches/2521_ProblemRefactoring
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring
- Property svn:ignore
-
old new 24 24 protoc.exe 25 25 obj 26 .vs
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/2521_ProblemRefactoring/HeuristicLab.Optimizer
- Property svn:mergeinfo changed
-
branches/2521_ProblemRefactoring/HeuristicLab.Optimizer/3.3/Plugin.cs.frame
r13321 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 20 20 #endregion 21 21 22 using System.Drawing; 22 23 using System.Linq; 23 24 using System.Windows.Forms; … … 27 28 28 29 namespace HeuristicLab.Optimizer { 29 [Plugin("HeuristicLab.Optimizer", "3.3.1 3.$WCREV$")]30 [Plugin("HeuristicLab.Optimizer", "3.3.15.$WCREV$")] 30 31 [PluginFile("HeuristicLab.Optimizer-3.3.dll", PluginFileType.Assembly)] 31 32 [PluginDependency("HeuristicLab.Clients.Common", "3.3")] … … 47 48 } 48 49 49 [Application("Optimizer", "HeuristicLab Optimizer 3.3.1 3.$WCREV$")]50 [Application("Optimizer", "HeuristicLab Optimizer 3.3.15.$WCREV$")] 50 51 internal class HeuristicLabOptimizerApplication : ApplicationBase { 51 52 public override void Run(ICommandLineArgument[] args) { … … 61 62 62 63 if (mainForm != null) { 64 if (CheckSavedMainFormSettings()) { 65 mainForm.Location = Settings.Default.MainFormLocation; 66 mainForm.Size = Settings.Default.MainFormSize; 67 mainForm.WindowState = Settings.Default.MainFormWindowState; 68 } 69 70 mainForm.FormClosing += (sender, eventArgs) => { 71 if (mainForm.WindowState != FormWindowState.Minimized) 72 Settings.Default.MainFormWindowState = mainForm.WindowState; 73 if (mainForm.WindowState != FormWindowState.Normal) { 74 Settings.Default.MainFormLocation = mainForm.RestoreBounds.Location; 75 Settings.Default.MainFormSize = mainForm.RestoreBounds.Size; 76 } else if (mainForm.WindowState == FormWindowState.Normal) { 77 Settings.Default.MainFormLocation = mainForm.Location; 78 Settings.Default.MainFormSize = mainForm.Size; 79 } 80 }; 81 82 63 83 ClientInformation.InitializeAsync(); 64 84 UserInformation.InitializeAsync(); … … 72 92 } 73 93 } 94 95 private bool CheckSavedMainFormSettings() { 96 var formArea = new Rectangle(Settings.Default.MainFormLocation, Settings.Default.MainFormSize); 97 var screenArea = Screen.FromRectangle(formArea).WorkingArea; 98 var overlappingArea = Rectangle.Intersect(formArea, screenArea); 99 bool offLimits = overlappingArea.IsEmpty || overlappingArea.Width * overlappingArea.Height < formArea.Width * formArea.Height * 0.25; 100 return !formArea.IsEmpty && !offLimits; 101 } 74 102 } 75 103 }
Note: See TracChangeset
for help on using the changeset viewer.