protected override bool OnMouseUp(MouseEventArgs eventArgs) { if ((Control.ModifierKeys & Keys.Shift) <= Keys.None) { return(false); } base.OnMouseUp(eventArgs); WorkflowView parentView = base.ParentView; if (!base.DragRectangle.IsEmpty && (parentView.RootDesigner != null)) { ActivityDesigner[] intersectingDesigners = CompositeActivityDesigner.GetIntersectingDesigners(parentView.RootDesigner, base.DragRectangle); ArrayList list = new ArrayList(); foreach (ActivityDesigner designer in intersectingDesigners) { list.Add(designer.Activity); } ISelectionService service = base.GetService(typeof(ISelectionService)) as ISelectionService; if ((list.Count > 0) && (service != null)) { service.SetSelectedComponents((object[])list.ToArray(typeof(object)), SelectionTypes.Replace); } } return(true); }
protected override bool OnMouseUp(MouseEventArgs eventArgs) { if ((Control.ModifierKeys & Keys.Shift) > 0) { base.OnMouseUp(eventArgs); //Select all the shapes WorkflowView parentView = ParentView; if (!DragRectangle.IsEmpty && parentView.RootDesigner != null) { ActivityDesigner[] intersectingDesigners = CompositeActivityDesigner.GetIntersectingDesigners(parentView.RootDesigner, DragRectangle); ArrayList selectableComponents = new ArrayList(); foreach (ActivityDesigner activityDesigner in intersectingDesigners) { selectableComponents.Add(activityDesigner.Activity); } ISelectionService selectionService = GetService(typeof(ISelectionService)) as ISelectionService; if (selectableComponents.Count > 0 && selectionService != null) { selectionService.SetSelectedComponents((object[])selectableComponents.ToArray(typeof(object)), SelectionTypes.Replace); } } return(true); } return(false); }