Exemplo n.º 1
0
        public vista(string path, string key, tiposdebusqueda tipobusqueda)
        {
            InitializeComponent();
            this.StartPosition   = FormStartPosition.CenterScreen;
            this.FormBorderStyle = FormBorderStyle.Fixed3D;
            this.MaximizeBox     = false;

            this.path = path;
            this.key  = key;
            this.s1   = new Stopwatch();


            this.tipobusqueda      = tipobusqueda;
            this.busquedas         = new rutinas();
            this.files             = new fileoperations();
            this.lblkey.Text       = key;
            this.source            = this.files.getdataSplit(this.path);
            this.lblelementos.Text = this.source.Length.ToString() + " Elementos";


            switch (tipobusqueda)
            {
            case (tiposdebusqueda.ITERATIVA):
            {
                this.lblnombremetodo.Text = "ITERATIVA";
                break;
            }

            case (tiposdebusqueda.RECURSIVA):
            {
                this.lblnombremetodo.Text = "RECURSIVA";
                break;
            }
            }

            this.Text = "Resultados de Busqueda";
        }
Exemplo n.º 2
0
        public central()
        {
            InitializeComponent();
            this.ocultar();
            this.Text            = "Analisis de Rendimiento de Algoritmos de Busqueda";
            this.StartPosition   = FormStartPosition.CenterScreen;
            this.FormBorderStyle = FormBorderStyle.Fixed3D;
            this.MaximizeBox     = false;
            this.rtb1.ReadOnly   = true;

            this.nupdtotal.ValueChanged += (sender, args) => { int.TryParse(this.nupdtotal.Value.ToString(), out this.xlength); };
            this.nupd1.ValueChanged     += (sender, args) => { int.TryParse(this.nupd1.Value.ToString(), out this.limita); };
            this.nupd2.ValueChanged     += (sender, args) => { int.TryParse((this.nupd2.Value + 1).ToString(), out this.limitb); };

            this.nupdtotal.KeyPress += (sender, args) => { if (args.KeyChar == (char)Keys.Enter)
                                                           {
                                                               this.btngenerar();
                                                           }
            };
            this.nupdtotal.Maximum = 9999999999999999999;
            this.nupdtotal.Text    = "";
            this.nupd1.Minimum     = -20;
            this.nupd2.Minimum     = -20;
            this.nupd1.Maximum     = 1000000;
            this.nupd2.Maximum     = 1000000;
            this.nupd1.Value       = -20;
            this.nupd2.Value       = 20;


            this.random = new Random(System.DateTime.Today.Millisecond);
            this.watch  = new Stopwatch();

            this.button1.Click += (sender, args) =>
            {
                this.btngenerar();
            };

            this.btnsave.Click += (sender, args) => { this.btnsaverut(); };

            this.btnsave2.Click += (sender, args) => { this.btnsaverut2(); };

            this.btnopenfile.Click += (sender, args) => { this.btnopenrut(); };

            this.btnopen2.Click += (sender, args) => { this.btnopenrut2(); };
            this.files           = new fileoperations();

            this.svd = new SaveFileDialog()
            {
                Title            = "Guardar Documento", Filter = ".txt (Texto)|*.txt",
                InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop),
                // CheckFileExists = true,
                CheckPathExists  = true,
                RestoreDirectory = true
            };

            this.ofd = new OpenFileDialog()
            {
                Title            = "Abrir Documento", Filter = ".txt (Texto)|*.txt",
                InitialDirectory = @"C:\Users\VestigiumSenex\Desktop",
                CheckFileExists  = true,
                CheckPathExists  = true,
                RestoreDirectory = true
            };

            this.mostrarcandado();

            this.cbrec.Checked = true;

            this.txtkey.KeyPress += (sender, args) => { if (args.KeyChar == (char)Keys.Enter)
                                                        {
                                                            this.btnbuscarrutina();
                                                        }
            };
            this.btnbuscar.Click += (sender, args) => { this.btnbuscarrutina(); };
        }