public void VisitStructure(Structure structure) { var flatSequence = structure as FlatSequence; var loop = structure as SourceModel.Loop; if (flatSequence != null) { VisitRebarFlatSequence(flatSequence); } else if (loop != null) { VisitLoop(loop); } }
private void TranslateStructure( Structure structure, Func <NationalInstruments.Dfir.Diagram, NationalInstruments.Dfir.Structure> createStructure, Func <NationalInstruments.Dfir.Structure, NationalInstruments.Dfir.Diagram> createNestedDiagram) { var dfirStructure = createStructure(_currentDiagram); _map.AddMapping(structure, dfirStructure); _map.AddMapping(structure.NestedDiagrams.First(), dfirStructure.Diagrams.First()); foreach (var additionalDiagram in structure.NestedDiagrams.Skip(1)) { NationalInstruments.Dfir.Diagram additionalDfirDiagram = createNestedDiagram(dfirStructure); _map.AddMapping(additionalDiagram, additionalDfirDiagram); } foreach (BorderNode borderNode in structure.BorderNodes) { MapBorderNode(borderNode, TranslateBorderNode(borderNode, dfirStructure)); } structure.NestedDiagrams.ForEach(nestedDiagram => nestedDiagram.AcceptVisitor(this)); }
public void VisitStructure(Structure structure) { var flatSequence = structure as FlatSequence; var loop = structure as SourceModel.Loop; var optionPatternStructure = structure as SourceModel.OptionPatternStructure; var variantMatchStructure = structure as SourceModel.VariantMatchStructure; if (flatSequence != null) { VisitRebarFlatSequence(flatSequence); } else if (loop != null) { VisitLoop(loop); } else if (optionPatternStructure != null) { VisitOptionPatternStructure(optionPatternStructure); } else if (variantMatchStructure != null) { VisitVariantMatchStructure(variantMatchStructure); } }