Ejemplo n.º 1
0
        /// <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();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnDelete_Click(object sender, System.EventArgs e)
        {
            if (listDriveMappings.SelectedObjects.Count == 0)
            {
                return;
            }

            DialogResult dr = UserInterface.DisplayQuestionMessageBox(this, "Are you sure you want to delete the mapping?");

            if (dr != System.Windows.Forms.DialogResult.Yes)
            {
                return;
            }

            DriveMapping dm = (DriveMapping)listDriveMappings.SelectedObjects[0];

            listDriveMappings.RemoveObject(dm);

            SetListViewButtonStatus();
        }