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); }
public static void SetVisibleState(WindowProperties properties, Form form) { bool minimized = properties.Minimized; if (minimized) { form.WindowState = FormWindowState.Normal; } else { form.WindowState = FormWindowState.Minimized; } }
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; } }
public static void ToggleVisibility(WindowProperties properties, Form form) { properties.Minimized = !properties.Minimized; ScreenUtils.SetVisibleState(properties, form); }