MainWindow.xaml.vb |
Private Function ProcessRouteResults(ByVal results As List(Of BingRouteResult)) As String
If results Is Nothing Then
Return ""
End If
Dim sb As New StringBuilder("RouteResults:" & ControlChars.Lf)
For i As Integer = 0 To results.Count - 1
sb.Append(String.Format("_________________________" & ControlChars.Lf))
sb.Append(String.Format("Path {0}:" & ControlChars.Lf, i+1))
sb.Append(String.Format("Distance: {0}" & ControlChars.Lf, results(i).Distance))
sb.Append(String.Format("Time: {0}" & ControlChars.Lf, results(i).Time))
sb.Append(ProcessLegs(results(i).Legs))
Next i
Return sb.ToString()
End Function
|
MainWindow.xaml.cs |
string ProcessRouteResults(List<BingRouteResult> results) {
if (results == null) return "";
StringBuilder sb = new StringBuilder("RouteResults:\n");
for (int i = 0; i < results.Count; i++) {
sb.Append(String.Format("_________________________\n"));
sb.Append(String.Format("Path {0}:\n", i+1));
sb.Append(String.Format("Distance: {0}\n", results[i].Distance));
sb.Append(String.Format("Time: {0}\n", results[i].Time));
sb.Append(ProcessLegs(results[i].Legs));
}
return sb.ToString();
}
|