Ejemplo n.º 1
0
 public SchemaPropertyInfo(Dictionary <string, string> defaultConverters, Dictionary <string, string> propertyConverters, Dictionary <string, string> arrayHelpers, DAG <string, JToken> typesGraph)
 {
     _defaultConverters  = defaultConverters;
     _propertyConverters = propertyConverters;
     _arrayHelpers       = arrayHelpers;
     _typesGraph         = typesGraph;
 }
Ejemplo n.º 2
0
 public SchemaEnumInfo(string nameSpace, string enumName, DAG <string, JToken> typesGraph) : base(typesGraph)
 {
     Name      = enumName;
     NameSpace = nameSpace;
     Schema.Add("type", "enum");
     Schema.Add("name", Name);
     if (nameSpace != null)
     {
         Schema.Add("namespace", nameSpace);
     }
     Schema.Add("symbols", _symbols);
 }
Ejemplo n.º 3
0
        public SchemaRecordInfo(string nameSpace, string recordName, DAG <string, JToken> typesGraph) : base(typesGraph)
        {
            Name      = recordName;
            NameSpace = nameSpace;
            Schema.Add("type", "record");
            Schema.Add("name", recordName);
            if (nameSpace != null)
            {
                Schema.Add("namespace", nameSpace);
            }

            _typesGraph.AddOrUpdateNode(recordName, Schema);
            Schema.Add("fields", _fields);
        }
        private void Visit(DAG <I, T> .Node root, List <I> visited, Action <I, T> visit)
        {
            visited.Add(root.Id);
            foreach (var n in root.Edges)
            {
                if (!visited.Contains(n.Id))
                {
                    try
                    {
                        Visit(n, visited, visit);
                    }
                    catch
                    {
                        Console.Error.WriteLine($"node {root.Id} value {root.Value}");
                        throw;
                    }
                }
            }

            if (visit != null)
            {
                visit(root.Id, root.Value);
            }
        }
 public DAGDepthFirstTraverser(DAG <I, T> graph)
 {
     Graph = graph;
 }
Ejemplo n.º 6
0
 public SchemaInfo(DAG <string, JToken> typesGraph)
 {
     _typesGraph = typesGraph;
 }