private void programaObjetoToolStripMenuItem_Click(object sender, EventArgs e) { if (objv.Visible) { objv.Select(); } else { objv = new ObjViewer(lineas_obj); objv.StartPosition = FormStartPosition.Manual; objv.Location = new Point(this.Location.X - this.Size.Width, this.Location.Y); objv.Show(); } }
private int CargaArchivoObjeto(string filepath) { StreamReader file = new StreamReader(filepath); if (file == null) { return(0); } file.Close(); lineas_obj = File.ReadLines(filepath).ToList(); _obj_file_path = filepath; CargadorSic cargador = new CargadorSic(); if (cargador.CargaProgramaObjeto(lineas_obj, _sic_machine) == 1) { MessageBox.Show("Programa cargado correctamente"); _sic_machine.Reset(); textBox_PNAME.Text = _sic_machine.ProgName; textBox_PSIZE.Text = _sic_machine.ProgSize.ToString() + " bytes"; ActualizaRegistros(); toolStrip1.Enabled = true; programaObjetoToolStripMenuItem.Enabled = true; objv = new ObjViewer(lineas_obj); if (hv.Visible) { hv.Close(); } hv = new HexViewer(_sic_machine.Memory); hv.StartPosition = FormStartPosition.Manual; hv.Location = new Point(this.Location.X + this.Size.Width, this.Location.Y); hv.Show(); hv.SelectLocation(_sic_machine.PC, 3); } else { MessageBox.Show("No se pudo cargar el programa objeto, verifique el que arlchivo tenga un formato correcto."); return(0); } return(1); }