public virtual SLExpression Visit(SLExpression expression) { var expType = expression.GetType().Name; switch (expType) { case "DrawingExpression": return(VisitDrawing((DrawingExpression)expression)); case "PolygonFromLinesExpression": return(VisitPolygonFromLines((PolygonFromLinesExpression)expression)); case "PolygonFromPointsExpression": return(VisitPolygonFromPoints((PolygonFromPointsExpression)expression)); case "IdentifiedLineExpression": return(VisitIdentifiedLine((IdentifiedLineExpression)expression)); case "TwoPointsLineExpression": return(VisitTwoPointsLine((TwoPointsLineExpression)expression)); case "HalfwayPointExpression": return(VisitHalfwayPoint((HalfwayPointExpression)expression)); case "CoordinatesPointExpression": return(VisitCoordinatesPoint((CoordinatesPointExpression)expression)); case "LineExtremityPointExpression": return(VisitLineExtremityPoint((LineExtremityPointExpression)expression)); case "LineReferenceExpression": return(VisitLineReference((LineReferenceExpression)expression)); case "LinesIntersectionPointExpression": return(VisitLinesIntersectionPoint((LinesIntersectionPointExpression)expression)); case "EquidistantPointExpression": return(VisitEquidistantPoint((EquidistantPointExpression)expression)); case "SideLengthAndPositionSquareExpression": return(VisitSideLengthAndPositionSquare((SideLengthAndPositionSquareExpression)expression)); case "DefinedByTwoPointsPointExpression": return(VisitDefinedByTwoPointsPoint((DefinedByTwoPointsPointExpression)expression)); default: throw new NotImplementedException(expType); } }