/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnEdit_Click(object sender, System.EventArgs e) { if (listDriveMappings.SelectedObjects.Count == 0) { return; } DriveMapping dm = (DriveMapping)listDriveMappings.SelectedObjects[0]; using (FormDriveMapping form = new FormDriveMapping()) { form.DriveMapping = dm; if (form.ShowDialog(this) == DialogResult.Cancel) { return; } dm.OriginalDrive = form.DriveMapping.OriginalDrive; dm.MappedDrive = form.DriveMapping.MappedDrive; dm.IsWindowsDrive = form.DriveMapping.IsWindowsDrive; listDriveMappings.RefreshObject(dm); SetListViewButtonStatus(); } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnAdd_Click(object sender, System.EventArgs e) { using (FormDriveMapping form = new FormDriveMapping()) { if (form.ShowDialog(this) == DialogResult.Cancel) { return; } listDriveMappings.AddObject(form.DriveMapping); listDriveMappings.SelectedObject = form.DriveMapping; SetListViewButtonStatus(); } }