public override void Start() { if (!this.mySelectionSet) { base.CurrentObject = base.View.PickObject(true, false, base.FirstInput.DocPoint, true); if (base.CurrentObject == null) { return; } this.MoveOffset = DiagramTool.SubtractPoints(base.FirstInput.DocPoint, base.CurrentObject.Position); } base.StartTransaction(); if (!this.mySelectionSet && !base.Selection.Contains(base.CurrentObject)) { if (base.FirstInput.Shift || base.FirstInput.Control) { base.Selection.Add(base.CurrentObject); } else { base.Selection.Select(base.CurrentObject); } } if (this.HidesSelectionHandles) { this.mySelectionHidden = true; base.Selection.RemoveAllSelectionHandles(); } if (!this.mySelectionSet && base.View.AllowDragOut) { this.myModalDropped = false; try { SizeF ef1 = DiagramTool.SubtractPoints(base.LastInput.DocPoint, base.Selection.Primary.Position); base.Selection.HotSpot = ef1; this.DoDragDrop(base.Selection, DragDropEffects.Move | (DragDropEffects.Copy | DragDropEffects.Scroll)); } catch (SecurityException exception1) { Shapes.DiagramShape.Trace("GoToolDragging Start: " + exception1.ToString()); return; } finally { if (!this.myModalDropped) { this.DoCancelMouse(); } else { base.StopTool(); } base.Selection.HotSpot = new SizeF(); } } }
public override void DoCancelMouse() { if ((base.CurrentObject != null) && (this.DragSelection == null)) { SizeF ef1 = DiagramTool.SubtractPoints(base.FirstInput.DocPoint, this.MoveOffset); base.View.MoveSelection((this.EffectiveSelection != null) ? this.EffectiveSelection : base.Selection, DiagramTool.SubtractPoints(ef1, base.CurrentObject.Position), false); } base.TransactionResult = null; base.StopTool(); }
public virtual void MakeDragSelection() { if (this.DragSelection == null) { this.DragSelectionOriginalObject = base.CurrentObject; this.DragSelection = this.CreateDragSelection(); if ((this.DragSelection == null) || this.DragSelection.IsEmpty) { this.DragSelectionOriginalObject = null; this.DragSelection = null; } else { base.View.MoveSelection((this.EffectiveSelection != null) ? this.EffectiveSelection : base.Selection, DiagramTool.SubtractPoints(DiagramTool.SubtractPoints(base.FirstInput.DocPoint, this.MoveOffset), this.DragSelectionOriginalObject.Position), false); if (base.CurrentObject.View != base.View) { base.CurrentObject = this.DragSelection.Primary; } } } }
public virtual void DoDragging(InputState evttype) { if (base.CurrentObject != null) { SizeF ef1 = DiagramTool.SubtractPoints(base.LastInput.DocPoint, base.CurrentObject.Position); SizeF ef2 = new SizeF(ef1.Width - this.MoveOffset.Width, ef1.Height - this.MoveOffset.Height); bool flag1 = this.MustBeCopying(); DiagramViewSnapStyle style1 = base.View.GridSnapDrag; if (this.EffectiveSelection == null) { this.myEffectiveSelection = this.ComputeEffectiveSelection(base.Selection, !flag1); } if (evttype != InputState.Finish) { bool flag2 = style1 == DiagramViewSnapStyle.Jump; if (flag1 || !base.View.DragsRealtime) { this.MakeDragSelection(); base.View.MoveSelection(this.DragSelection, ef2, flag2); } else { this.ClearDragSelection(); base.View.MoveSelection(this.EffectiveSelection, ef2, flag2); } } else { SizeF ef3 = new SizeF(); if (this.DragSelection != null) { ef3 = DiagramTool.SubtractPoints(base.CurrentObject.Position, this.DragSelectionOriginalObject.Position); this.ClearDragSelection(); } else { ef3 = ef2; } bool flag3 = (style1 == DiagramViewSnapStyle.Jump) || (style1 == DiagramViewSnapStyle.After); if (flag1) { if (this.CopiesEffectiveSelection) { base.View.CopySelection(this.ComputeEffectiveSelection(base.Selection, false), ef3, flag3); } else { base.View.CopySelection(base.Selection, ef3, flag3); } } else { if (this.EffectiveSelection == null) { this.myEffectiveSelection = this.ComputeEffectiveSelection(base.Selection, true); } base.View.MoveSelection(this.EffectiveSelection, ef3, flag3); } } } }