Example #1
0
 public Form1()
 {
     InitializeComponent();
     CodeReader codeReader = new CodeReader();
     codeReader.ReadCodeFile("");
     CustomInitialize();
 }
Example #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            ModelReaderCS modelReader = new ModelReaderCS(comboBox1.SelectedItem.ToString());
            CodeProcessor.CodeWriter.ModelWriterCS modelWriter = new CodeProcessor.CodeWriter.ModelWriterCS();
            modelWriter.ToProgrammingLanguage(modelReader.ElementProgram);

            CodeReader codeReader = new CodeReader();
            List<CodeElement> codeElements = codeReader.ReadCodeFile(comboBox1.SelectedItem.ToString());
            DataModel.BL.DataModel.rootCodeElements = codeElements;
            this.Close();
        }
Example #3
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);
         }
     }
 }
Example #4
0
 public CodeSection(string filePath, string fileContent, int beginSection, int level)
 {
     Visibility = (int) Visible.Internal;
     FilePath = filePath;
     this.beginSection = beginSection;
     //this.endSection = endSection;
     //this.codeContent = fileContent.Substring(beginSection, endSection - beginSection).Trim();
     CodeReader codeReader = new CodeReader();
     CodeSections = codeReader.GetAllCodeElements(filePath, fileContent, beginSection, level+1);
     ReturnType = "Undefined";
 }