public Form1() { InitializeComponent(); CodeReader codeReader = new CodeReader(); codeReader.ReadCodeFile(""); CustomInitialize(); }
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(); }
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); } } }
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"; }