/// <summary> /// Adds something to the definesDictionary. Expects that we're adding something on the /// most recent line; it checks the previous line for a DocumentationFileComponent. /// </summary> void AddDefinition(string def, string value) { Project.AddDefinition(def, value); DocumentationFileComponent doc = null; if (fileStructure.Count >= 2) { doc = fileStructure[fileStructure.Count - 2] as DocumentationFileComponent; } definesDictionary[def] = new Tuple <string, DocumentationFileComponent>(value, doc); }
public Documentation(DocumentationFileComponent fileComponent, string name) { Name = name; _fieldDict = new Dictionary <string, string>(); foreach (string key in fileComponent.Keys) { if (key == "desc") { Description = fileComponent.GetField(key); } else { _fieldDict[key.ToLower()] = fileComponent.GetField(key); } } _fieldKeys = new HashSet <string>(fileComponent.Keys); _fieldKeys.Remove("desc"); }
public Documentation GetSubDocumentation(string field) { string value = GetField(field); if (value == null) { return(null); } Documentation newDoc = new Documentation(this); List <string> newKeys = new List <string>(); Dictionary <string, string> newFields = DocumentationFileComponent.ParseDoc(value, newKeys); foreach (string key in newKeys) { newDoc._fieldKeys.Add(key); newDoc._fieldDict[key.ToLower()] = newFields[key]; } newDoc.Name = Name + " (" + field + ")"; return(newDoc); }