Пример #1
0
 public static void WriteToFile(string path, RequestGraph graph)
 {
     GraphSerializer.WriteToFile <RequestGraph, RequestNode>(
         path,
         graph,
         WriteGraphProperties,
         WriteNode);
 }
Пример #2
0
        public static void WriteToGraphvizFile(string path, RequestGraph graph)
        {
            var builder = new StringBuilder();

            GraphSerializer.WriteToGraphvizFile(
                path,
                graph,
                n => GetNodeLabel(builder, n));
        }
Пример #3
0
 private static void WriteGraphProperties(JsonTextWriter j, RequestGraph graph)
 {
     if (graph.Sources.Any())
     {
         j.WritePropertyName("s");
         j.WriteStartArray();
         foreach (var source in graph.Sources)
         {
             j.WriteValue(source);
         }
         j.WriteEndArray();
     }
 }
Пример #4
0
 private static void ReadGraphProperty(JsonSerializer serializer, JsonReader j, RequestGraph graph)
 {
     switch ((string)j.Value)
     {
     case "s":
         j.Read();
         graph.Sources.AddRange(serializer.Deserialize <List <string> >(j));
         break;
     }
 }