示例#1
0
        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);
        }
示例#2
0
 public virtual void Show()
 {
     Form         = OnCreateForm();
     Form.Closed += OnClosed;
     Form.Show();
 }