Пример #1
0
        private void Preload(ILayoutPlugin layout)
        {
            SuspendLayout();
            Toolkit.SuspendDrawing(this);

            backLayout = layout;
            backLayout.Control.Dock = DockStyle.Fill;
            backLayout.Control.Visible = false;
            this.Controls.Add(backLayout.Control);

            pictureBox1.Visible = false;

            ResumeLayout();
            Toolkit.ResumeDrawing(this);
        }
Пример #2
0
        private ILayoutPlugin Switch()
        {
            ILayoutPlugin toBeDisposedOf = null;

            SuspendLayout();
            Toolkit.SuspendDrawing(this);

            // Remove the old foreground panel
            backLayout.Control.Visible = true;
            if (foreLayout != null)
            {
                foreLayout.Control.Parent = null;
            }

            toBeDisposedOf = foreLayout;

            // The background panel
            // becomes visible as the foreground panel

            foreLayout = backLayout;
            backLayout = null;
            pictureBox1.Visible = false;

            // Refresh screen

            ResumeLayout();
            Toolkit.ResumeDrawing(this);
            Refresh();
            foreLayout.Viewed();

            return toBeDisposedOf;
        }
Пример #3
0
 private void CancelPreload(ILayoutPlugin layout)
 {
     if (backLayout == layout)
     {
         this.Controls.Remove(backLayout.Control);
         backLayout = null;
     }
 }