/// <summary> /// Draw bezier-curve by NodeCollection. /// </summary> /// <param name="drawingSession"> The drawing-session. </param> /// <param name="nodeCollection"> The NodeCollection. </param> public static void DrawNodeCollection(this CanvasDrawingSession drawingSession, NodeCollection nodeCollection) { foreach (Node node in nodeCollection) { switch (node.Type) { case NodeType.BeginFigure: { Vector2 vector = node.Point; if (node.IsChecked == false) { if (node.IsSmooth == false) { drawingSession.DrawNode3(vector, Windows.UI.Colors.Gold); } else { drawingSession.DrawNode(vector, Windows.UI.Colors.Gold); } } else { if (node.IsSmooth == false) { drawingSession.DrawNode4(vector, Windows.UI.Colors.Gold); } else { //Right Vector2 rightControlPoint = node.RightControlPoint; drawingSession.DrawLineDodgerBlue(vector, rightControlPoint); drawingSession.DrawNode5(rightControlPoint, Windows.UI.Colors.Gold); //Left Vector2 leftControlPoint = node.LeftControlPoint; drawingSession.DrawLineDodgerBlue(vector, leftControlPoint); drawingSession.DrawNode5(leftControlPoint, Windows.UI.Colors.Gold); drawingSession.DrawNode2(vector, Windows.UI.Colors.Gold); } } } break; case NodeType.Node: { Vector2 vector = node.Point; if (node.IsChecked == false) { if (node.IsSmooth == false) { drawingSession.DrawNode3(vector); } else { drawingSession.DrawNode(vector); } } else { if (node.IsSmooth == false) { drawingSession.DrawNode4(vector); } else { //Right Vector2 rightControlPoint = node.RightControlPoint; drawingSession.DrawLineDodgerBlue(vector, rightControlPoint); drawingSession.DrawNode5(rightControlPoint); //Left Vector2 leftControlPoint = node.LeftControlPoint; drawingSession.DrawLineDodgerBlue(vector, leftControlPoint); drawingSession.DrawNode5(leftControlPoint); drawingSession.DrawNode2(vector); } } } break; case NodeType.EndFigure: break; } } }