예제 #1
0
        private static void UndockFromPanel(ref SystemWindow systemWindow)
        {
            systemWindow.UndockFromPanel();

            if (Settings.Instance.EnableLogger)
                Logger.Debug("(MainForm - UndockFromPanel) Maximizing window after undocking.");

            systemWindow.Maximize();

            systemWindow = null;
        }
예제 #2
0
        private void DockToPanel(SystemWindow systemWindow, PanelEnum panel)
        {
            if (Settings.Instance.EnableLogger)
                Logger.Debug("(MainForm - DockToPanel) Docking window: {0}.", systemWindow.FullName);

            if (Settings.Instance.EnableLogger)
                Logger.Debug("(MainForm - DockToPanel) Maximizing window.");

            if (systemWindow.Parent != null && systemWindow.Parent.IsMinimized)
            {
                if (Settings.Instance.EnableLogger)
                    Logger.Debug("(MainForm - DockToPanel) Maximizing parent for Delphi applications.");

                systemWindow.Parent.Restore();
            }
            else
            {
                systemWindow.Restore();
            }
            systemWindow.Maximize();

            switch (panel)
            {
                case PanelEnum.First:
                    if (Settings.Instance.EnableLogger)
                        Logger.Debug("(MainForm - DockToPanel) Docking first window: {0}.", systemWindow.FullName);

                    systemWindow.DockToPanel(splitContainerApps.Panel1);
                    if (_firstEventAssigned == false)
                    {
                        splitContainerApps.Panel1.SizeChanged += systemWindow.PanelSizeChanged;
                        _firstEventAssigned = true;
                    }
                    break;

                case PanelEnum.Second:
                    if (Settings.Instance.EnableLogger)
                        Logger.Debug("(MainForm - DockToPanel) Docking second window: {0}.", systemWindow.FullName);

                    systemWindow.DockToPanel(splitContainerApps.Panel2);
                    if (_secondEventAssigned == false)
                    {
                        splitContainerApps.Panel2.SizeChanged += systemWindow.PanelSizeChanged;
                        _secondEventAssigned = true;
                    }
                    break;
            }

            systemWindow.PanelSizeChanged(panel == PanelEnum.First ? splitContainerApps.Panel1 : splitContainerApps.Panel2, new EventArgs());

            if (Settings.Instance.EnableLogger)
                Logger.Debug("(MainForm - DockToPanel) Docking windows ends.");
        }