protected override bool OnButtonDown(Point pointerPosition) { this.pathPartAdorner = (PathPartAdorner)this.ActiveAdorner; this.isConstrainingAxes = this.IsShiftDown; this.startRootPoint = pointerPosition; this.currentEditingElement = this.pathPartAdorner.Element; bool isShiftDown = this.IsShiftDown; int num = this.IsAltDown ? true : false; bool isControlDown = this.IsControlDown; PathPointAdorner pathPointAdorner = this.pathPartAdorner as PathPointAdorner; PathTangentAdorner pathTangentAdorner = this.pathPartAdorner as PathTangentAdorner; PathSegmentAdorner pathSegmentAdorner = this.pathPartAdorner as PathSegmentAdorner; this.pathEditorTargets.Clear(); if (pathTangentAdorner != null) { pathTangentAdorner.PathAdornerSet.SetActive((PathPartAdorner)pathTangentAdorner, true); this.isEnforcingSmoothness = this.ShouldEnforceSmoothness(pathTangentAdorner); } else { PathPartSelectionSet partSelectionSet = this.ActiveSceneViewModel.PathPartSelectionSet; PathPart pathPart = (PathPart)null; if (pathPointAdorner != null) { pathPart = (PathPart)(PathPoint)pathPointAdorner; } else if (pathSegmentAdorner != null) { pathPart = (PathPart)(PathSegment)pathSegmentAdorner; } if (isShiftDown) { partSelectionSet.ExtendSelection(pathPart); } else if (isControlDown && this.ToolBehaviorContext.ActiveTool is ISelectionTool) { partSelectionSet.ToggleSelection(pathPart); if (!partSelectionSet.IsSelected(pathPart)) { this.currentEditingElement = (BaseFrameworkElement)null; } } else if (!partSelectionSet.IsSelected(pathPart)) { partSelectionSet.Clear(); partSelectionSet.ExtendSelection(pathPart); } if (partSelectionSet.IsSelected(pathPart) && pathSegmentAdorner != null) { this.ComputeSegmentParameter(); } } this.ToolBehaviorContext.SnappingEngine.Start(this.ToolBehaviorContext, (BaseFrameworkElement)null, (IList <BaseFrameworkElement>)null); return(true); }
public override bool Equals(object obj) { PathPart pathPart = obj as PathPart; if (pathPart != (PathPart)null && this.FigureIndex == pathPart.FigureIndex && (this.PartIndex == pathPart.PartIndex && this.sceneElement == pathPart.SceneElement) && this.pathEditMode == pathPart.PathEditMode) { return(this.partType == pathPart.partType); } return(false); }
protected override bool OnClickEnd(Point pointerPosition, int clickCount) { if (clickCount == 2) { List <PathPart> list = new List <PathPart>(); foreach (PathPartAdorner pathPartAdorner in (IEnumerable)this.pathPartAdorner.PathAdornerSet.Adorners) { PathPart pathPart = pathPartAdorner.ToPathPart(); if (pathPart != (PathPart)null) { list.Add(pathPart); } } this.ActiveSceneViewModel.PathPartSelectionSet.SetSelection((ICollection <PathPart>)list, false); } return(this.AllDone()); }
public virtual int CompareTo(object obj) { if (obj == null) { return(1); } PathPart pathPart = obj as PathPart; if (pathPart == (PathPart)null) { throw new ArgumentException(string.Format((IFormatProvider)CultureInfo.CurrentCulture, ExceptionStringTable.PathPartInvalidCompare, new object[2] { (object)this.ToString(), (object)obj.ToString() })); } if (this.SceneElement != pathPart.SceneElement) { return(SceneNode.MarkerCompare((SceneNode)this.SceneElement, (SceneNode)pathPart.SceneElement)); } if (this.pathEditMode != pathPart.PathEditMode) { return(this.pathEditMode.CompareTo((object)pathPart.PathEditMode)); } if (this.PathPartType != pathPart.PathPartType) { return(this.PathPartType >= pathPart.PathPartType ? 1 : -1); } if (this.FigureIndex != pathPart.FigureIndex) { return(this.FigureIndex >= pathPart.FigureIndex ? 1 : -1); } if (this.PartIndex == pathPart.PartIndex) { return(0); } return(this.PartIndex >= pathPart.PartIndex ? 1 : -1); }