protected virtual void OnNodeSelected(WorkflowOutlineNode node) { ISelectionService service = this.GetService(typeof(ISelectionService)) as ISelectionService; if (((service != null) && (node != null)) && (service.PrimarySelection != node.Activity)) { WorkflowView view = this.GetService(typeof(WorkflowView)) as WorkflowView; if (view != null) { view.EnsureVisible(node.Activity); } service.SetSelectedComponents(new object[] { node.Activity }, SelectionTypes.Replace); } }
//gets called when user selected a node in the activity tree protected virtual void OnNodeSelected(WorkflowOutlineNode node) { ISelectionService selectionService = GetService(typeof(ISelectionService)) as ISelectionService; if (selectionService != null && node != null && selectionService.PrimarySelection != node.Activity) { // make the selected shape visible (note - the order is important, EnsureVisible will // expand appropiate branches and set CAG into edit mode, which is crucial for // SetSelectedComponents to perform well) WorkflowView workflowView = GetService(typeof(WorkflowView)) as WorkflowView; if (workflowView != null) { workflowView.EnsureVisible(node.Activity); } // select it selectionService.SetSelectedComponents(new object[] { node.Activity }, SelectionTypes.Replace); } }