Exemplo n.º 1
0
 private void dockPanel_ActiveDocumentChanged(object sender, EventArgs e)
 {
     if (dockPanel.ActiveDocument != null && dockPanel.ActiveDocument.GetType() == typeof(BaseWindow))
     {
         projectExplorer.changeProjectItemSelection(((ToolWindow)dockPanel.ActiveDocument).Text, ((BaseWindow)dockPanel.ActiveDocument).TypeOfWindow);
         propertyWindow.propertyGrid.SelectedObject = ((BaseWindow)dockPanel.ActiveDocument).baseFrame;
         dbSettings.CurrentBaseWindow = (BaseWindow)dockPanel.ActiveDocument;
         currentBaseWindow            = (BaseWindow)dockPanel.ActiveDocument;
         if (((BaseWindow)dockPanel.ActiveDocument).TypeOfWindow == FormDesignerConstants.FormPattern)
         {
             displayNameExplorer.initExplorer();
             displayNameExplorer.comboBox1.SelectedText      = "";
             UIEventManager.ContextMenu.MenuItems[0].Enabled = true;
             UIEventManager.ContextMenu.MenuItems[2].Enabled = true;
             UIEventManager.ContextMenu.MenuItems[3].Enabled = true;
         }
         else if (((BaseWindow)dockPanel.ActiveDocument).TypeOfWindow == FormDesignerConstants.DataPattern)
         {
             UIEventManager.ContextMenu.MenuItems[0].Enabled = false;
             UIEventManager.ContextMenu.MenuItems[2].Enabled = false;
             UIEventManager.ContextMenu.MenuItems[3].Enabled = false;
         }
         else if (((BaseWindow)dockPanel.ActiveDocument).TypeOfWindow == FormDesignerConstants.WorkflowPattern)
         {
             UIEventManager.ContextMenu.MenuItems[0].Enabled = false;
             UIEventManager.ContextMenu.MenuItems[2].Enabled = false;
             UIEventManager.ContextMenu.MenuItems[3].Enabled = false;
         }
     }
 }