public void Setup() { workspace = new DeckWorkspace(); smartPart = new MockWPFSmartPart(); catalog = new MockWPFUIElementAdapter(); workspace.WPFUIElementAdapter = catalog; }
public override void Run() { log.Debug("PartModelingManager.ModuleController.Run"); AddServices(); ExtendMenu(); ExtendToolStrip(); AddViews(); PrepareOcaf(); // Create child WorkItems at the current WorkItem for the Sketcher and the PartModeling _modulePartModelingWorkItem = WorkItem.WorkItems.AddNew <WorkItem>(ControllerNames.PartModellingController); _moduleSketcherWorkItem = WorkItem.WorkItems.AddNew <WorkItem>(ControllerNames.SketcherController); // Create a Layout on the MdiManager from the RootWorkItem, both child WorkItems will use it for display ResourceManager resources = new ResourceManager(typeof(ModelingManagerResources)); WindowSmartPartInfo smartPartInfo = new WindowSmartPartInfo(); smartPartInfo.Title = "New part"; smartPartInfo.Icon = (System.Drawing.Icon)resources.GetObject("NaroIcon"); DeckWorkspace deckWorkspace = new DeckWorkspace(); WorkItem.Items.Add(deckWorkspace); //deckWorkspace.Name = WorkspaceNames.DrawingAreaWorkspace; WorkItem.RootWorkItem.Workspaces[WorkspaceNames.LayoutWorkspace].Show(deckWorkspace, smartPartInfo); WorkItem.RootWorkItem.Workspaces[WorkspaceNames.LayoutWorkspace].SmartPartActivated += new EventHandler <WorkspaceEventArgs>(ModuleController_SmartPartActivated); WorkItem.RootWorkItem.Workspaces[WorkspaceNames.LayoutWorkspace].SmartPartClosing += new EventHandler <WorkspaceCancelEventArgs>(ModuleController_SmartPartClosing); // Register on the current WorkItem the TreeViewWorkspace and DrawingAreaWorkspace to point to this layout _modulePartModelingWorkItem.Workspaces.Add(deckWorkspace, WorkspaceNames.DrawingAreaWorkspace); //_modulePartModelingWorkItem.Workspaces.Add(WorkItem.Workspaces[WorkspaceNames.TreeViewWorkspace], WorkspaceNames.TreeViewWorkspace); _moduleSketcherWorkItem.Workspaces.Add(deckWorkspace, WorkspaceNames.DrawingAreaWorkspace); //_moduleSketcherWorkItem.Workspaces.Add(WorkItem.Workspaces[WorkspaceNames.TreeViewWorkspace], WorkspaceNames.TreeViewWorkspace); // Start the two child WorkItems _partModelingWorkItem = _modulePartModelingWorkItem.WorkItems.AddNew <ControlledWorkItem <Naro.PartModeling.ModuleController> >("PartModelingController"); log.Debug("Part modeling Run"); _partModelingWorkItem.Controller.Run(); log.Debug("Sketcher Run"); _sketcherWorkItem = _moduleSketcherWorkItem.WorkItems.AddNew <ControlledWorkItem <Naro.Sketcher.ModuleController> >("SketcherController"); _sketcherWorkItem.Controller.Run(); // Start the flow by activating the 3D modeling WorkItem _currentWorkItem = _partModelingWorkItem; log.Debug("Part modeling ResumeRunning"); _partModelingWorkItem.Controller.ResumeRunning(); // Show the StartSketcher Toolstrip //IShellExtensionService extensionService = this.WorkItem.Services.Get<IShellExtensionService>(); //extensionService.BeginUpdateLayout(); //extensionService.ShowToolstrip(this.WorkItem, Constants.UIExtensionSiteNames.StartSketcher); //extensionService.EndUpdateLayout(); }
public void CloseShowsPreviouslyVisibleControl() { workspace = new DeckWorkspace(); MockSmartPart c1 = new MockSmartPart(); MockSmartPart c2 = new MockSmartPart(); workspace.Show(c1); workspace.Show(c2); workspace.Close(c2); Assert.AreSame(c1, workspace.ActiveSmartPart); }
public void WorkspaceFiresDisposedEvent() { bool disposed = false; DeckWorkspace workspace = new DeckWorkspace(); Form form = new Form(); form.Controls.Add(workspace); form.Show(); workspace.Disposed += delegate { disposed = true; }; form.Close(); Assert.IsTrue(disposed); }
public void Setup() { workspace = new DeckWorkspace(); smartPart = new MockSmartPart(); }
public void LoadViewWorkspace() { _userRoleAssignmentDeckWorkspace = new DeckWorkspace(); this.ultraTabPageControl2.Controls.Add(_userRoleAssignmentDeckWorkspace); _userRoleAssignmentDeckWorkspace.Name = String.Format("{0} - {1}", HiiP.Framework.Security.UserManagement.Constants.WorkspaceNames.UserRoleAssignmentDeckWorkspace, _presenter.Key); _userRoleAssignmentDeckWorkspace.Dock = DockStyle.Fill; }
public void LoadViewWorkspace() { _assignRolesToUsersWorkspace = new DeckWorkspace(); this.functionalRolesUltraGroupBox.Controls.Add(_assignRolesToUsersWorkspace); _assignRolesToUsersWorkspace.Name = _assignRolesToUsersWorkspaceName; _assignRolesToUsersWorkspace.Dock = DockStyle.Fill; }