示例#1
0
        private void Abrir(object sender, EventArgs e)
        {
            OpenFileDialog open = new OpenFileDialog {
                InitialDirectory = Application.StartupPath + "\\example",
                Filter           = "SIC File|*.s|SICXE File|*.x"
            };

            if (open.ShowDialog() == DialogResult.OK)
            {
                ruta             = Directory.GetParent(open.FileName).ToString();
                tbPrograma.Lines = File.ReadAllLines(open.FileName);
                if (open.FileName.EndsWith(".x"))
                {
                    SICXE = true;
                }
                else if (open.FileName.EndsWith(".s"))
                {
                    SICXE = false;
                }
                string[] files = open.FileName.Split((char)92);
                string[] file  = files[files.Length - 1].Split('.');
                nombre = file[0];
                TbPrograma_TextChanged(this, null);
                ActiveForm.Text       = "SIC - " + nombre;
                DireccionArchivo.Text = open.FileName;

                EstablecerBotonesArchivo(true, true, true, true, true, true);
                EstablecerBotonesEnsamblador(true, false, false);
                EstablecerBotonesEjecutar(true, false);
                tbPrograma.Enabled = true;

                prog = new Programa();
                intermedio.Rows.Clear();
                dataGridTabSim.Rows.Clear();
                tbErrores.Clear();
                tbRegistros.Clear();
                textBoxRes.BackColor = Color.White;
                textBoxRes.Text      = "";
            }
        }
示例#2
0
        private void Nuevo(object sender, EventArgs e)
        {
            tbPrograma.Text       = "";
            tbLinea.Text          = "";
            tbErrores.Text        = "";
            nombre                = "";
            ActiveForm.Text       = "SIC";
            DireccionArchivo.Text = "";
            LongitudPrograma.Text = "";

            EstablecerBotonesArchivo(true, true, true, true, true, true);
            EstablecerBotonesEnsamblador(true, false, false);
            EstablecerBotonesEjecutar(false, false);
            tbPrograma.Enabled = true;

            prog = new Programa();
            intermedio.Rows.Clear();
            dataGridTabSim.Rows.Clear();
            tbErrores.Clear();
            tbRegistros.Clear();
            textBoxRes.BackColor = Color.White;
            textBoxRes.Text      = "";
        }