public NamespaceDescription(ANamespaceDecl ns) { decl = ns; LineFrom = decl.GetToken().Line; if (decl.GetEndToken() == null) LineTo = int.MaxValue; else LineTo = decl.GetEndToken().Line; SourceFileContents.Parser parser = new SourceFileContents.Parser(ns); //if (Structs.Count != parser.Structs.Count && Form1.Form.CurrentOpenFile != null && Form1.Form.CurrentOpenFile.OpenFile != null) // Form1.Form.CurrentOpenFile.OpenFile.Editor.Restyle(); Methods = parser.Methods; foreach (MethodDescription method in Methods) { method.ParentFile = this; } Fields = parser.Fields; foreach (VariableDescription field in Fields) { field.ParentFile = this; } Structs = parser.Structs; foreach (StructDescription structDescription in Structs) { foreach (MethodDescription method in structDescription.Methods) { method.ParentFile = this; } foreach (VariableDescription field in structDescription.Fields) { field.ParentFile = this; } structDescription.ParentFile = this; } Enrichments = parser.Enrichments; foreach (EnrichmentDescription structDescription in Enrichments) { structDescription.ParentFile = this; foreach (MethodDescription method in structDescription.Methods) { method.ParentFile = this; } foreach (VariableDescription field in structDescription.Fields) { field.ParentFile = this; } } Typedefs = parser.Typedefs; foreach (TypedefDescription typedef in Typedefs) { typedef.ParentFile = this; } Usings = parser.Usings; Namespaces = parser.Namespaces; foreach (NamespaceDescription namespaceDescription in Namespaces) { namespaceDescription.Parent = this; } Position = TextPoint.FromCompilerCoords(ns.GetName()); }
public NamespaceDescription(ANamespaceDecl ns) { decl = ns; LineFrom = decl.GetToken().Line; if (decl.GetEndToken() == null) { LineTo = int.MaxValue; } else { LineTo = decl.GetEndToken().Line; } SourceFileContents.Parser parser = new SourceFileContents.Parser(ns); //if (Structs.Count != parser.Structs.Count && Form1.Form.CurrentOpenFile != null && Form1.Form.CurrentOpenFile.OpenFile != null) // Form1.Form.CurrentOpenFile.OpenFile.Editor.Restyle(); Methods = parser.Methods; foreach (MethodDescription method in Methods) { method.ParentFile = this; } Fields = parser.Fields; foreach (VariableDescription field in Fields) { field.ParentFile = this; } Structs = parser.Structs; foreach (StructDescription structDescription in Structs) { foreach (MethodDescription method in structDescription.Methods) { method.ParentFile = this; } foreach (VariableDescription field in structDescription.Fields) { field.ParentFile = this; } structDescription.ParentFile = this; } Enrichments = parser.Enrichments; foreach (EnrichmentDescription structDescription in Enrichments) { structDescription.ParentFile = this; foreach (MethodDescription method in structDescription.Methods) { method.ParentFile = this; } foreach (VariableDescription field in structDescription.Fields) { field.ParentFile = this; } } Typedefs = parser.Typedefs; foreach (TypedefDescription typedef in Typedefs) { typedef.ParentFile = this; } Usings = parser.Usings; Namespaces = parser.Namespaces; foreach (NamespaceDescription namespaceDescription in Namespaces) { namespaceDescription.Parent = this; } Position = TextPoint.FromCompilerCoords(ns.GetName()); }