Search
RoutePattern Constructor (String)
See Also
 





Initializes a new instance of the RoutePattern class.

Namespace: MindFusion.Diagramming
Package: MindFusion.Diagramming

 Syntax

C#  Copy Code

public RoutePattern (
    string data
)

Visual Basic  Copy Code

Public New ( _
    data As String _
)

 Parameters

data

A string representing a sequence of RouteSteps.

 Remarks

Members of the RouteStepKind enumeration are represented by three-character acronyms, with a numerical value appended to advance- steps.

 Example

The following route can be represented by "ADR0.5 TRR ADR1 TRL ADR0.5" string.

C#  Copy Code

var rightZigzag = new RoutePattern();
rightZigzag.Steps.Add(
    new RouteStep(RouteStepKind.AdvanceRelative, 0.5f));
rightZigzag.Steps.Add(
    new RouteStep(RouteStepKind.TurnRight));
rightZigzag.Steps.Add(
    new RouteStep(RouteStepKind.AdvanceRelative, 1));
rightZigzag.Steps.Add(
    new RouteStep(RouteStepKind.TurnLeft));
rightZigzag.Steps.Add(
    new RouteStep(RouteStepKind.AdvanceRelative, 0.5f));
router.Patterns.Add(rightZigzag);

// this can be defined in shorter form using a pattern string
// var rightZigzag = new RoutePattern(
//     "ADR0.5 TRR ADR1 TRL ADR0.5"));

 See Also