internal static (Point Location, Size Size) Normalize(IWin32Form form, Point restoreLocation, Size restoreSize) { var size = restoreSize == Size.Empty ? form.Size : EnsureMinimumSize(form.MinimumSize, restoreSize); var location = restoreLocation; if (restoreLocation == Point.Empty || !SystemInformation.VirtualScreen.IntersectsWith(new Rectangle(location, size))) { location = CenterOnPrimaryScreen(size); } return(location, size); }
public virtual void Show() { Form = OnCreateForm(); Form.Closed += OnClosed; Form.Show(); }