CodeTV.MainForm.ChangeVideoMode C# (CSharp) Method

ChangeVideoMode() private method

private ChangeVideoMode ( VideoMode videoMode ) : void
videoMode VideoMode
return void
        private void ChangeVideoMode(VideoMode videoMode)
        {
            switch (this.currentVideoMode)
            {
                case VideoMode.Normal:
                    this.panelVideo.Controls.Remove(this.videoControl);
                    break;
                case VideoMode.TV:
                    this.videoForm.Owner = null;
                    this.currentTVModeBounds = this.videoForm.Bounds;
                    this.videoForm.Controls.Remove(this.videoControl);
                    break;
                case VideoMode.Fullscreen:
                    Cursor.Show();
                    this.videoForm.Controls.Remove(this.videoControl);
                    break;
            }
            this.currentVideoMode = videoMode;
            switch (videoMode)
            {
                case VideoMode.Normal:
                    this.videoForm.Hide();
                    this.videoForm.FormVideoMode = videoMode;
                    this.panelVideo.Controls.Add(this.videoControl);
                    //Bounds = RestoreBounds;
                    WindowState = FormWindowState.Normal;
                    Show();
                    break;
                case VideoMode.TV:
                    Hide();
                    this.videoForm.SuspendLayout();
                    this.videoForm.FormVideoMode = videoMode;
                    this.videoForm.TopMost = true;
                    this.videoForm.FormBorderStyle = FormBorderStyle.SizableToolWindow;
                    if (this.currentTVModeBounds.Height != 0)
                        this.videoForm.Bounds = this.currentTVModeBounds;
                    else
                        this.videoForm.DesktopBounds = new Rectangle(new Point(this.DesktopLocation.X + (this.Size.Width - Form.DefaultSize.Width) / 2, this.DesktopLocation.Y + (this.Size.Height - Form.DefaultSize.Height) / 2), Form.DefaultSize);
                    this.videoForm.Controls.Add(this.videoControl);
                    this.videoForm.ResumeLayout(false);
                    this.videoForm.UpdateSize();
                    this.videoForm.Show(this);
                    break;
                case VideoMode.Fullscreen:
                    Hide();
                    Cursor.Hide();
                    this.videoForm.FormVideoMode = videoMode;
                    this.videoForm.TopMost = false;
                    this.videoForm.FormBorderStyle = FormBorderStyle.None;
                    this.videoForm.DesktopBounds = Screen.FromControl(this).Bounds;
                    this.videoForm.Controls.Add(this.videoControl);
                    this.videoForm.Show();
                    break;
            }
            this.videoControl.Focus();
        }
MainForm