예제 #1
0
 public static void ApplyWindowProperties(WindowProperties properties, Form form)
 {
     form.ClientSize = properties.Size;
     form.Location   = properties.Location;
     if (properties.Maximized)
     {
         form.WindowState = FormWindowState.Maximized;
     }
     EnsureOnScreen(form);
 }
예제 #2
0
        public static void SetVisibleState(WindowProperties properties, Form form)
        {
            bool minimized = properties.Minimized;

            if (minimized)
            {
                form.WindowState = FormWindowState.Normal;
            }
            else
            {
                form.WindowState = FormWindowState.Minimized;
            }
        }
예제 #3
0
        public static void SaveWindowProperties(WindowProperties properties, Form form)
        {
            FormWindowState windowState = form.WindowState;

            if (windowState != FormWindowState.Normal)
            {
                if (windowState == FormWindowState.Maximized)
                {
                    properties.Maximized = true;
                }
            }
            else
            {
                properties.Size      = form.ClientSize;
                properties.Location  = form.Location;
                properties.Maximized = false;
            }
        }
예제 #4
0
 public static void ToggleVisibility(WindowProperties properties, Form form)
 {
     properties.Minimized = !properties.Minimized;
     ScreenUtils.SetVisibleState(properties, form);
 }