Exemple #1
0
 private void ExtractCodeNamespaces(string filePath)
 {
     FileAccess access = new FileAccess();
     string fileContent = access.GetFileContent(filePath).ToString();
     CodeReader codeReader = new CodeReader();
     CodeSections = codeReader.GetAllCodeElements(filePath, fileContent, 0, 0);
     foreach (CodeSection codeSection in CodeSections)
     {
         CodeElement codeElement = codeReader.ConvertToDataModel(codeSection);
     
         if (codeSection.BlockType == "namespace")
         {
             ElementNamespace elementNamespace = new ElementNamespace();
             elementNamespace.ElementName = filePath;
             //elementNamespace.ElementFile = filePath;
             ElementProgram.CodeNamespaces.Add(elementNamespace);
         }
     }
 }