private void chkSelectAll_CheckedChanged(object sender, EventArgs e) { for (var i = 0; i < ListBoxFiles.Items.Count; i++) { ListBoxFiles.SetItemChecked(i, chkSelectAll.Checked); } }
public AutosaveDialog(IO io) { this.Build(); string[] filenames = io.GetAutosaveFiles(); foreach (string s in filenames) { ListBoxFiles.AppendText(s); } ListBoxFiles.Active = 0; Result = false; }
private void ProcessPackageFileRequest() { var JarFilePath = ProcessJarFileRequest(); var dirPath = Path.GetDirectoryName(JarFilePath); foreach (var item in ListBoxFiles.Items) { if (ListBoxFiles.GetItemCheckState(ListBoxFiles.Items.IndexOf(item)) == CheckState.Unchecked) { File.Copy(Path.Combine(txtSourceFolder.Text, item.ToString()), Path.Combine(dirPath, Path.GetFileName(item.ToString()))); } } Process.Start(dirPath); }
private string ProcessJarFileRequest() { List <string> files = new List <string>(); foreach (var item in ListBoxFiles.Items) { if (ListBoxFiles.GetItemCheckState(ListBoxFiles.Items.IndexOf(item)) == CheckState.Checked) { files.Add(Path.Combine(txtSourceFolder.Text, item.ToString())); } } var jarFilePath = RuntimeHelper.MapToTempFolder(Path.Combine(Guid.NewGuid().ToString(), "include.jar")); GenerateJarFile(jarFilePath, files); return(jarFilePath); }
private void IncompleteTagButton_Click(object sender, EventArgs e) { var test = ListBoxFiles.Items; List <Song> InvalidSongMetaData = new List <Song>(); Double totalSongs = test.Count; Double count = 0; foreach (object obj in test) { Song song = (Song)obj; try { count++; PercentTag.Text = Math.Floor(100 * count / totalSongs).ToString() + "%"; Application.DoEvents(); var tfile = TagLib.File.Create(song.Filename); String Title = tfile.Tag.Title; String Album = tfile.Tag.Album; String Artist = tfile.Tag.FirstPerformer; if (!(IsValidMetadata(Title) && IsValidMetadata(Album) && IsValidMetadata(Artist))) { song.Display = Title + " " + Album + " " + Artist; InvalidSongMetaData.Add(song); } } catch (Exception ex) { song.Display = ex.Message + " " + song.Filename; InvalidSongMetaData.Add(song); } } ListBoxFiles.BeginUpdate(); ListBoxFiles.Items.Clear(); foreach (Song song in InvalidSongMetaData) { ListBoxFiles.Items.Add(song); } ListBoxFiles.EndUpdate(); }
private void ButtonLoadSongs_Click(object sender, EventArgs e) { String dir = Properties.Settings.Default.MusicDirectory; if (!Directory.Exists(dir)) { MessageBox.Show("Invalid Directory: " + dir); return; } List <string> songlist = new List <string>(); List <Song> songs = new List <Song>(); List <string> extensionList = Properties.Settings.Default.Extensions.Split(',').ToList <string>(); AddSongs(extensionList, songlist, dir); ConvertToSongName(songs, songlist); ListBoxFiles.BeginUpdate(); ListBoxFiles.Items.Clear(); foreach (Song song in songs) { ListBoxFiles.Items.Add(song); } ListBoxFiles.EndUpdate(); }
private void Window_ContentRendered(object sender, EventArgs e) { ListBoxFiles.Focus(); }