private static void Read(string json) { Hierarchy = new FileHierArchy(); Hierarchy.Classes = new List <Class>(); bool isClass = false; bool isProperty = false; JsonTextReader reader = new JsonTextReader(new StringReader(json)); while (reader.Read()) { if (reader.Value != null) { if (isClass) { Hierarchy.Classes.Add(new Class(reader.Value.ToString(), AccessModifier.Public)); isProperty = true; isClass = false; } Console.WriteLine("Token: {0}, Value: {1}", reader.TokenType, reader.Value); } else { Console.WriteLine("Token: {0}", reader.TokenType); if (reader.TokenType == JsonToken.StartObject) { isClass = true;//Hierarchy.Classes.Add(new Class { Name = }) } } } }
public FileHierArchy ConstructClass() { var dic = new Dictionary <string, object>(); var props = new Dictionary <string, string>(); FileHierarchy = new FileHierArchy(); FileHierarchy.Namespace = NameSpace; FileHierarchy.Classes = new List <Class>(); RecursiveClasses(IntialClassName, JObject); return(FileHierarchy); }
public NamespaceWriter(FileHierArchy fileHierArchy, bool addAttritbute) { this.FileHierarchy = fileHierArchy; this.AddAttritbute = addAttritbute; FileBuilder = new StringBuilder(); }