コード例 #1
0
 private void CompileEdgeEndPoint(StringBuilder builder, IDotElement endPoint)
 {
     if (endPoint is DotString leftEdgeString)
     {
         builder.Append($"{leftEdgeString.Value}");
     }
     else if (endPoint is DotNode leftEdgeNode)
     {
         builder.Append($"{leftEdgeNode.Identifier}");
     }
     else
     {
         throw new DotException($"Endpoint of an edge can't be of type: {endPoint.GetType()}");
     }
 }
コード例 #2
0
ファイル: DotCompiler.cs プロジェクト: vfrz/DotNetGraph
 private void CompileEdgeEndPoint(StringBuilder builder, IDotElement endPoint, bool formatStrings)
 {
     if (endPoint is DotString leftEdgeString)
     {
         builder.Append(SurroundStringWithQuotes(leftEdgeString.Value, formatStrings));
     }
     else if (endPoint is DotNode leftEdgeNode)
     {
         builder.Append(SurroundStringWithQuotes(leftEdgeNode.Identifier, formatStrings));
     }
     else
     {
         throw new DotException($"Endpoint of an edge can't be of type: {endPoint.GetType()}");
     }
 }