Exemplo n.º 1
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (textBox1.Text != "" && textBox2.Text != "")
     {
         RoboGitDLL.RoboGitFunc gitDLL = new RoboGitDLL.RoboGitFunc();
         gitDLL.configUser(textBox1.Text);
         gitDLL.configEmail(textBox2.Text);
         StreamWriter sw = new StreamWriter("globalconfig");
         sw.Write(textBox1.Text + "`" + textBox2.Text);
         sw.Close();
         this.Hide();
     }
     else
     {
         MessageBox.Show("You've left something blank!");
     }
 }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text.EndsWith(".git"))
            {

                string[] parseLink = textBox1.Text.Split('/');
                string newDirectoryname = parseLink[parseLink.Length - 1];
                string newDirectory = newDirectoryname.Substring(0, newDirectoryname.Length - 4);
                if (!Directory.Exists(textBox2.Text + textBox3.Text + newDirectory))
                {
                    string path = textBox2.Text + textBox3.Text;
                    RoboGitDLL.RoboGitFunc GitDLL = new RoboGitDLL.RoboGitFunc();
                    if (checkBox3.Checked == false)
                    {
                        GitDLL.Clone(textBox1.Text, path);
                    }
                    else
                    {
                        GitDLL.Clone(textBox1.Text, path, true);
                    }
                    if (checkBox2.Checked == true)
                    {
                        System.Diagnostics.Process.Start("explorer.exe", textBox2.Text + textBox3.Text + newDirectory);
                    }
                    saveRepoPath(textBox2.Text + textBox3.Text + newDirectory);
                    Form1 frmMain = new Form1();
                    frmMain.refreshList();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("Directory already exists!");
                }
            }
            else
            {
                MessageBox.Show("Invalid Git URL!");
            }
        }
Exemplo n.º 3
0
 private void button1_Click(object sender, EventArgs e)
 {
     string currentPath = System.IO.Directory.GetCurrentDirectory();
     if (checkBox1.Checked == true)
     {
         string repoPath = currentPath + textBox3.Text + textBox1.Text;
         if (!Directory.Exists(repoPath))
         {
             Directory.CreateDirectory(repoPath);
             RoboGitDLL.RoboGitFunc gitDLL = new RoboGitDLL.RoboGitFunc();
             if (checkBox3.Checked == false)
             {
                 gitDLL.Create(repoPath);
             }
             else if (checkBox3.Checked == true)
             {
                 gitDLL.Create(repoPath, true);
             }
             gitDLL.remoteAddOrigin(textBox4.Text, repoPath);
             if (checkBox2.Checked == true)
             {
                 System.Diagnostics.Process.Start("explorer.exe", repoPath);
             }
             saveRepoPath(repoPath);
             Form1 frmMain = new Form1();
             frmMain.refreshList();
             this.Hide();
         }
         else
         {
             MessageBox.Show("Directory Exists!");
         }
     }
     else if (checkBox1.Checked == false)
     {
         if (!Directory.Exists(textBox2.Text))
         {
             RoboGitDLL.RoboGitFunc gitDLL= new RoboGitDLL.RoboGitFunc();
             if (checkBox3.Checked == false)
             {
                 gitDLL.Create(textBox2.Text);
             }
             else if (checkBox3.Checked == true)
             {
                 gitDLL.Create(textBox2.Text, true);
             }
             gitDLL.remoteAddOrigin(textBox4.Text, textBox2.Text);
             if (checkBox2.Checked == true)
             {
                 System.Diagnostics.Process.Start("explorer.exe", textBox2.Text);
             }
             saveRepoPath(textBox2.Text);
             Form1 frmMain = new Form1();
             frmMain.refreshList();
             this.Hide();
         }
         else
         {
             MessageBox.Show("Directory Exists!");
         }
     }
 }