mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
cleaned up Screens class
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user