예제 #1
0
        private void WriteCurrentDriveListToDatabase()
        {
            List<PhysicalDriveData> currentDrives = DriveInfoScanner.ScanDrives();

            foreach (var drive in currentDrives)
            {
                string driveId = DBHelper.CheckDriveIdExists(drive);
                if ( driveId == "")
                {
                    // this is a new drive we have not seen before! Lets get a label/description for it.
                    LabelNewDrive dlg = new LabelNewDrive(drive);
                    dlg.ShowDialog();
                }
            }
        }
예제 #2
0
        private void dataGridViewDrives_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0)
                return;

            var data = (PhysicalDriveData)dataGridViewDrives.Rows[e.RowIndex].Tag;

            LabelNewDrive dlg = new LabelNewDrive(data);
    
            if ( dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK )
            {
                // user migth have changed name or drive comment. Lets repopulate the view
                PopulateListView();
            }
        }