Beispiel #1
0
 void DgTasksDoubleClick(object sender, EventArgs e)
 {
     try {
         if (dgTasks.RowCount > 0) {
             TaskForm f = new TaskForm(dgTasks.CurrentRow.Cells["GUID"].Value.ToString(),
                                       dgTasks.CurrentRow.Cells["cTask"].Value.ToString(),
                                       dgTasks.CurrentRow.Cells["cParams"].Value.ToString(),
                                       (bool) dgTasks.CurrentRow.Cells["cEnabled"].Value,
                                       (bool) dgTasks.CurrentRow.Cells["cSwOff"].Value);
             f.Owner = this;
             if ((f.ShowDialog() == DialogResult.OK) && (f.Path != "")) {
                 devmanager.moTask(f.GUID, f.Path, f.Params,
                                   f.IsActive, f.SwitchOffOnUmount);
             }
             fillTaskTable(lbDrives.SelectedItem.ToString()[0]);
         }
     } catch (Exception ex) {
         MessageBox.Show(ex.ToString() + "\n" + ex.Message, "Error",
                         MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Beispiel #2
0
 void BnAddClick(object sender, EventArgs e)
 {
     TaskForm f = new TaskForm();
     f.Owner = this;
     if (f.ShowDialog() == DialogResult.OK) {
         if (f.Path != "") {
             devmanager.addTask(lbDrives.SelectedItem.ToString()[0],
                                f.Path,
                                f.Params,
                                f.IsActive,
                                f.SwitchOffOnUmount);
             fillTaskTable(lbDrives.SelectedItem.ToString()[0]);
         }
     }
 }