Ejemplo n.º 1
0
 private void undoToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try {
         CustomM4Editor editor = (CustomM4Editor)tabControl1.SelectedTab.Controls[0];
         editor.deshacer();
     } catch (Exception ex) { }
 }
Ejemplo n.º 2
0
        private void executeObject(string fileName)
        {
            this.txtConsole.Clear();
            CustomM4Editor editor = (CustomM4Editor)tabControl1.SelectedTab.Controls[0];

            Process proc = new Process
            {
                StartInfo = new ProcessStartInfo
                {
                    FileName               = "scanner\\objeto\\" + fileName,
                    Arguments              = "\"" + editor.FileName + "\"",
                    UseShellExecute        = false,
                    RedirectStandardOutput = true,
                    CreateNoWindow         = true
                }
            };

            proc.Start();
            while (!proc.StandardOutput.EndOfStream)
            {
                string line      = proc.StandardOutput.ReadLine();
                var    decompose = line.Split('~');
                if (decompose.Count() >= 2)
                {
                    var lineNUmber = Convert.ToInt32(decompose[1]);
                    editor.create_hint(decompose[0], lineNUmber);
                }
                else
                {
                    this.txtConsole.Text += line + Environment.NewLine;
                }
                // do something with line
            }
        }
Ejemplo n.º 3
0
 private void selectAllToolStripMenuItem_Click(object sender, EventArgs e)
 {
     try {
         CustomM4Editor editor = (CustomM4Editor)tabControl1.SelectedTab.Controls[0];
         editor.seleccionarTodo();
     } catch (Exception ex) { }
 }
Ejemplo n.º 4
0
 private void saveToolStripButton_Click(object sender, EventArgs e)
 {
     try {
         CustomM4Editor editor = (CustomM4Editor)tabControl1.SelectedTab.Controls[0];
         editor.guardar();
         MessageBox.Show("Archivo guardado exitosamente", "Guardar", MessageBoxButtons.OK, MessageBoxIcon.Information);
     } catch (Exception ex) { }
 }
Ejemplo n.º 5
0
        private void createNewTabFromFile(string filePath)
        {
            String[] substrings = filePath.Split('\\');
            string   fileName   = substrings[substrings.Length - 1];


            TabPage        tab    = new TabPage(fileName);
            CustomM4Editor editor = new CustomM4Editor(filePath);

            editor.Dock             = DockStyle.Fill;
            editor.ContextMenuStrip = cmMain;

            tabControl1.TabPages.Add(tab);
            tab.Controls.Add(editor);
            changeFormText();
        }
Ejemplo n.º 6
0
        private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try {
                CustomM4Editor editor = (CustomM4Editor)tabControl1.SelectedTab.Controls[0];

                SaveFileDialog saveFileDialog1 = new SaveFileDialog();
                saveFileDialog1.Filter = "M4 file|*.m4";
                saveFileDialog1.Title  = "Save an M4 File";
                saveFileDialog1.ShowDialog();

                // If the file name is not an empty string open it for saving.
                if (saveFileDialog1.FileName != "")
                {
                    // Saves the Image via a FileStream created by the OpenFile method.
                    editor.FileName = saveFileDialog1.FileName;
                    editor.guardar();
                    MessageBox.Show("Archivo guardado exitosamente", "Guardar", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            } catch (Exception ex) { }
        }
Ejemplo n.º 7
0
        private void changeFormText()
        {
            CustomM4Editor editor = (CustomM4Editor)tabControl1.SelectedTab.Controls[0];

            this.Text = "IDE M4 - " + editor.FileName;
        }