public void Execute() { // We keep the list ordered. [0] = left. AbstractScreen temp = m_ScreenManagerKernel.screenList[0]; m_ScreenManagerKernel.screenList[0] = m_ScreenManagerKernel.screenList[1]; m_ScreenManagerKernel.screenList[1] = temp; // Show new disposition. ScreenManagerUserInterface smui = m_ScreenManagerKernel.UI as ScreenManagerUserInterface; if (smui != null) { smui.splitScreens.Panel1.Controls.Clear(); smui.splitScreens.Panel2.Controls.Clear(); smui.splitScreens.Panel1.Controls.Add(m_ScreenManagerKernel.screenList[0].UI); smui.splitScreens.Panel2.Controls.Add(m_ScreenManagerKernel.screenList[1].UI); } // the following lines are placed here so they also get called at unexecute. m_ScreenManagerKernel.OrganizeMenus(); m_ScreenManagerKernel.UpdateStatusBar(); m_ScreenManagerKernel.SwapSync(); m_ScreenManagerKernel.SetSyncPoint(true); }
public void Execute() { // - parse the current screen list and fill panels with screens. // - hide unused panels if necessary. ScreenManagerUserInterface smui = screenManagerKernel.UI as ScreenManagerUserInterface; if (smui != null) { // Empty the screen panels. smui.splitScreens.Panel1.Controls.Clear(); smui.splitScreens.Panel2.Controls.Clear(); smui.CloseThumbnails(); if (screenManagerKernel.screenList.Count == 1) { smui.pnlScreens.Visible = true; smui.AllowDrop = false; // left screen enabled. smui.splitScreens.Panel1Collapsed = false; smui.splitScreens.Panel1.AllowDrop = true; smui.splitScreens.Panel1.Controls.Add(screenManagerKernel.screenList[0].UI); // right screen disabled smui.splitScreens.Panel2Collapsed = true; smui.splitScreens.Panel2.AllowDrop = false; } else if (screenManagerKernel.screenList.Count == 2) { smui.pnlScreens.Visible = true; smui.AllowDrop = false; // left screen smui.splitScreens.Panel1Collapsed = false; smui.splitScreens.Panel1.AllowDrop = true; smui.splitScreens.Panel1.Controls.Add(screenManagerKernel.screenList[0].UI); // right screen smui.splitScreens.Panel2Collapsed = false; smui.splitScreens.Panel2.AllowDrop = true; smui.splitScreens.Panel2.Controls.Add(screenManagerKernel.screenList[1].UI); } else if (screenManagerKernel.screenList.Count == 0) { smui.pnlScreens.Visible = false; smui.AllowDrop = true; smui.splitScreens.Panel1.AllowDrop = false; smui.splitScreens.Panel2.AllowDrop = false; smui.BringBackThumbnails(); } } // Update status bar. screenManagerKernel.UpdateStatusBar(); }