private void crearToolStripMenuItem_Click(object sender, EventArgs e) { filePath = ""; ArchivoFuente newMDIChild = new ArchivoFuente(); newMDIChild.MdiParent = this; archfuente = newMDIChild; archfuente.Show(); }
private void cerrarToolStripMenuItem_Click(object sender, EventArgs e) { ArchivoFuente newMDIChild = new ArchivoFuente(); newMDIChild.MdiParent = this; archfuente = newMDIChild; archfuente.Show(); System.IO.StreamReader file = null; filePath = ""; string linea = ""; try { using (OpenFileDialog openFileDialog = new OpenFileDialog()) { openFileDialog.Filter = "SIC estandar (*.s)|*.s|SICXE (*.x)|*.x"; openFileDialog.FilterIndex = 2; openFileDialog.RestoreDirectory = true; if (openFileDialog.ShowDialog() == DialogResult.OK) { filePath = openFileDialog.FileName; } } if (filePath[filePath.Length - 1] == 'x') { extendido = true; } else { extendido = false; } file = new System.IO.StreamReader(filePath); while ((linea = file.ReadLine()) != null) { newMDIChild.cambiarText(linea + '\n'); } file.Close(); } catch (Exception ex) { System.Console.WriteLine("Archivo inexistente"); } }