コード例 #1
0
        private void toolStripBtnPostulate_Click(object sender, EventArgs e)
        {
            try
            {
                var binData = richTxtBxData.Text;

                var btn    = sender as ToolStripButton;
                var indice = int.Parse(btn.Tag.ToString());

                toolStripStLblPostulate.Text = "Postulado " + indice;
                toolStripStLblInfo.Text      = "Analizando...";
                toolStripStLblTime.Text      = "";
                Application.DoEvents();

                var inicio = DateTime.Now;
                _postulates.postulado(indice, binData, (int)numUDBits.Value);
                var tiempo = DateTime.Now - inicio;

                switch (indice)
                {
                case 1:
                    toolStripBtnR1.Enabled = true;
                    _details = new formDetails(indice, _postulates.AnalisisP1);
                    break;

                case 2:
                    toolStripBtnR2.Enabled = true;
                    _details = new formDetails(indice, _postulates.AnalisisP2, (int)numUDBits.Value);
                    break;

                case 3:
                    toolStripBtnR3.Enabled = true;
                    _details = new formDetails(indice, _postulates.AnalisisP3);
                    break;
                }

                toolStripStLblInfo.Text = binData.Length + " binarios";
                toolStripStLblTime.Text = tiempo.ToString("g");

                Hide();
                _details.ShowDialog(this);
                Show();
            }
            catch (Exception ex)
            {
                toolStripStLblInfo.Text = "error";

                MessageBox.Show("Ocurrio un error, por favor revise las entradas\n" + ex.Message, "ERROR",
                                MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1,
                                MessageBoxOptions.ServiceNotification);
            }
        }
コード例 #2
0
        private void toolStripBtnPostulateResult_Click(object sender, EventArgs e)
        {
            try
            {
                var inicio = DateTime.Now;

                var btn    = sender as ToolStripButton;
                var indice = int.Parse(btn.Tag.ToString());

                toolStripStLblPostulate.Text = "Detalles del postulado " + indice;
                toolStripStLblInfo.Text      = "Cargando...";
                toolStripStLblTime.Text      = "";
                Application.DoEvents();

                switch (indice)
                {
                case 1:
                    _details = new formDetails(indice, _postulates.AnalisisP1);
                    break;

                case 2:
                    _details = new formDetails(indice, _postulates.AnalisisP2, (int)numUDBits.Value);
                    break;

                case 3:
                    _details = new formDetails(indice, _postulates.AnalisisP3);
                    break;
                }

                var tiempo = DateTime.Now - inicio;
                toolStripStLblInfo.Text = "";
                toolStripStLblTime.Text = tiempo.ToString("g");
                Application.DoEvents();

                Hide();
                _details.ShowDialog(this);
                Show();
            }
            catch (Exception ex)
            {
                toolStripStLblInfo.Text = "error";

                MessageBox.Show("Ocurrio un error, por favor revise las entradas\n" + ex.Message, "ERROR",
                                MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1,
                                MessageBoxOptions.ServiceNotification);
            }
        }