Ejemplo n.º 1
0
        private void metroButton1_Click(object sender, EventArgs e)
        {
            if (this.getfilesandvalidations())
            {
                this.Hide();

                LoadingCode loadingForm = new LoadingCode(
                    txt_ubication.Text + "\\" + (myTI.ToTitleCase(txt_namefile.Text.ToLower().Replace(".cs", ""))).Replace(" ", "") + "\\" + txt_namefile.Text.Replace(" ", "") + ".cs",
                    txt_namefile.Text.Replace(" ", ""),
                    "Creando proyecto");
                loadingForm.ShowDialog();
            }
        }
Ejemplo n.º 2
0
        private void btn_openfile_Click(object sender, EventArgs e)
        {
            OpenFileDialog op = new OpenFileDialog();

            op.InitialDirectory = "Documents";
            op.Filter           = "c# files(*.cs)| *.cs";
            op.RestoreDirectory = true;
            if (op.ShowDialog() == DialogResult.OK)
            {
                path = op.FileName;
                StringBuilder sb = new StringBuilder();
                using (StreamReader sr = new StreamReader(path))
                {
                    while (sr.Peek() >= 0)
                    {
                        sb.AppendLine(sr.ReadLine());
                    }
                }

                LoadingCode _loader = new LoadingCode(path, Path.GetFileName(path), "Cargando proyecto");
                _loader.ShowDialog();
                this.Hide();
            }
        }