private void button6_Click(object sender, EventArgs e) { SelectDriveForm sdf = new SelectDriveForm(); if (sdf.ShowDialog() == DialogResult.OK) { // check if a removable drive System.IO.DriveInfo di = sdf.SelectedDrive; if (di.DriveType != System.IO.DriveType.Removable) { if (di.DriveType == System.IO.DriveType.Ram) { MessageBox.Show("You have selected a RAM drive. This is not allowed."); return; } else if (di.DriveType == System.IO.DriveType.NoRootDirectory) { MessageBox.Show("The Selected drive doesn't have a root Directory!"); return; } DialogResult r = MessageBox.Show("Warning: The drive you have selected isn't a removable drive.\nContinue?", "OH NOES!", MessageBoxButtons.YesNo); if (r == System.Windows.Forms.DialogResult.No) { return; } } // generate Drive info IITPlaylist device = GetPlaylistNameForm.InputBox(); Device newDevice = new Device(device, di); listBox1.Items.Add(newDevice.Name.ToUpper() + " (" + newDevice.iTunesPlaylist.Name + ")"); ManagedDrives.Add(newDevice); //MessageBox.Show("To put songs on your device, drag them onto the playlist, \n" + "Then press 'sync'"); } }
public static IITPlaylist InputBox() { GetPlaylistNameForm gdnf = new GetPlaylistNameForm(); gdnf.ShowDialog(); return(gdnf.Result); }
public static IITPlaylist InputBox() { GetPlaylistNameForm gdnf = new GetPlaylistNameForm(); gdnf.ShowDialog(); return gdnf.Result; }