Пример #1
0
 private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.ColumnIndex == Column_open.Index)
     {
         var p   = db.GetByName(dataGridView1[column_Project.Index, e.RowIndex].Value + "");
         var frm = new Form_MRB_Git(db, p);
         frm.ObjToolStripMenuItem.Checked       = ObjToolStripMenuItem.Checked;
         frm.rstToolStripMenuItem.Checked       = rstToolStripMenuItem.Checked;
         frm.largfilesToolStripMenuItem.Checked = largfilesToolStripMenuItem.Checked;
         frm.Show(this);
     }
 }
Пример #2
0
 private void backupToolStripMenuItem_Click(object sender, EventArgs e)
 {
     foreach (DataGridViewRow r in dataGridView1.SelectedRows)
     {
         var p = db.GetByName(r.Cells[column_Project.Index].Value + "");
         if ((p.LocalPath + "").Replace("\\", "").Trim() == "" || (db.settings.BackUpServer + "").Replace("\\", "").Trim() == "")
         {
             using (var frm = new Form_MRB_Git(db, p))
             {
                 frm.ObjToolStripMenuItem.Checked       = ObjToolStripMenuItem.Checked;
                 frm.rstToolStripMenuItem.Checked       = rstToolStripMenuItem.Checked;
                 frm.baktmpasvToolStripMenuItem.Checked = baktmpasvToolStripMenuItem.Checked;
                 frm.largfilesToolStripMenuItem.Checked = largfilesToolStripMenuItem.Checked;
                 frm.groupBox2.Enabled = false;
                 frm.ShowDialog(this);
                 frm.Close();
                 if ((p.LocalPath + "").Replace("\\", "").Trim() == "" || (db.settings.BackUpServer + "").Replace("\\", "").Trim() == "")
                 {
                     return;
                 }
                 r.Cells[Column_dir.Index].Value = (p.LocalPath + "*").Replace("\\*", "").Replace("*", "");
             }
         }
     }
     foreach (DataGridViewRow r in dataGridView1.SelectedRows)
     {
         using (var frm = new Form_MRB_Git(db, db.GetByName(r.Cells[column_Project.Index].Value + "")))
         {
             frm.ObjToolStripMenuItem.Checked       = ObjToolStripMenuItem.Checked;
             frm.rstToolStripMenuItem.Checked       = rstToolStripMenuItem.Checked;
             frm.largfilesToolStripMenuItem.Checked = largfilesToolStripMenuItem.Checked;
             frm.Show(this);
             frm.groupBox1.Enabled = false;
             frm.groupBox2.Enabled = false;
             frm.button_backup_Click(this, null);
             while (frm.backgroundWorker_back.IsBusy)
             {
                 Application.DoEvents();
                 System.Threading.Thread.Sleep(30);
             }
             frm.Hide();
         }
     }
 }
Пример #3
0
        private void dataGridView1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            var p = db.GetByName(dataGridView1[column_Project.Index, e.RowIndex].Value + "");

            if (e.ColumnIndex == Column_dir.Index)
            {
                folderBrowserDialog1.SelectedPath = p.LocalPath;
                if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
                {
                    dataGridView1[e.ColumnIndex, e.RowIndex].Value = p.LocalPath = folderBrowserDialog1.SelectedPath;
                }
            }
            else
            {
                var frm = new Form_MRB_Git(db, p);
                frm.ObjToolStripMenuItem.Checked       = ObjToolStripMenuItem.Checked;
                frm.rstToolStripMenuItem.Checked       = rstToolStripMenuItem.Checked;
                frm.largfilesToolStripMenuItem.Checked = largfilesToolStripMenuItem.Checked;
                frm.Show(this);
            }
        }