/// <summary> /// Processes. /// </summary> public override void Process() { if (dispatcher == null) { return; } var hasArg = Arguments.Count > 1 && !string.IsNullOrWhiteSpace(Arguments[1]); if (!hasArg) { WriteMessage(dispatcher.DefaultVerbFactory, false); System.Console.WriteLine(); } foreach (var item in hasArg ? dispatcher.VerbFactorysRegistered(Arguments[1]) : dispatcher.VerbFactorysRegistered()) { System.Console.WriteLine(item.MatchDescription); if (hasArg) { System.Console.WriteLine(); } WriteMessage(item.VerbFactory, hasArg); System.Console.WriteLine(); } if (!hasArg) { LineUtilities.WriteDoubleLines(FurtherDescription); } }
public void MoveToEndOf(Line line) { var lineEnd = LineUtilities.EndPoint(line); Canvas.SetLeft(this, lineEnd.X - 10); Canvas.SetTop(this, lineEnd.Y - 10); }
public void OnLineTargeted(object line, EventArgs e) { if (line is SnappableLine snappableLine) { LineUtilities.MoveLineTo(PreviewLine, snappableLine); } }
public void PositionLabelBelowCenterOfLine() { var midPoint = LineUtilities.MidPoint(new Point(Line.X1, Line.Y1), new Point(Line.X2, Line.Y2)); SetLeft(Label, midPoint.X); SetTop(Label, midPoint.Y); }
public void OnMouseMove(object source, MouseEventArgs e) { if (_previewLineManager.IsActive() && source is IInputElement element) { RenderPreviewLine(LineUtilities.StartPoint(_previewLineManager.PreviewLine.Line), element); } }
public void OnEditModeActivated(DrawableLine source, LineDragEventArgs e) { if (e.Direction is LineResizeGrip.DragDirection.Start) { LineUtilities.ChangeDirection(PreviewLine.Line); } PreviewLine.Show(); }
private void OnLineDragged(DrawableLine source, MouseButtonEventArgs e) { if (source is SnappableLine line) { _lineManager.MoveLine(line, LineUtilities.StartPoint(line.Line), e.GetPosition(_grid)); } else { source.Move(LineUtilities.StartPoint(source.Line), e.GetPosition(_grid)); } }
public void Update() { Content = ((int)Math.Round(LineUtilities.Distance(new Point(_line.X1, _line.Y1), new Point(_line.X2, _line.Y2)))).ToString(); }
public PointToLineDistance DistanceFrom(Point point) { return(LineUtilities.GetClosestPointOnLineSegment(point, Line)); }