cleaned up Screens class

This commit is contained in:
David Sparer
2017-05-07 16:19:11 -06:00
parent 7b5a805eda
commit 98d813c172

View File

@@ -6,32 +6,31 @@ namespace mRemoteNG.App
{
public static class Screens
{
public static void SendFormToScreen(Screen Screen)
public static void SendFormToScreen(Screen screen)
{
bool wasMax = false;
var frmMain = FrmMain.Default;
var wasMax = false;
if (FrmMain.Default.WindowState == FormWindowState.Maximized)
if (frmMain.WindowState == FormWindowState.Maximized)
{
wasMax = true;
FrmMain.Default.WindowState = FormWindowState.Normal;
frmMain.WindowState = FormWindowState.Normal;
}
FrmMain.Default.Location = Screen.Bounds.Location;
frmMain.Location = screen.Bounds.Location;
if (wasMax)
{
FrmMain.Default.WindowState = FormWindowState.Maximized;
frmMain.WindowState = FormWindowState.Maximized;
}
}
public static void SendPanelToScreen(DockContent Panel, Screen Screen)
public static void SendPanelToScreen(DockContent panel, Screen screen)
{
Panel.DockState = DockState.Float;
if (Panel.ParentForm != null)
{
Panel.ParentForm.Left = Screen.Bounds.Location.X;
Panel.ParentForm.Top = Screen.Bounds.Location.Y;
}
panel.DockState = DockState.Float;
if (panel.ParentForm == null) return;
panel.ParentForm.Left = screen.Bounds.Location.X;
panel.ParentForm.Top = screen.Bounds.Location.Y;
}
}
}