private void LocalFiles_LocalFiles_Click(object sender, EventArgs e) { uLocalFiles localFiles = sender as uLocalFiles; string title = deleteFolder.Replace("\"Music\"", "\"" + localFiles.Title + "\""); if (MessageBox.Show(title, captionDelete, MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) { RemovePath(localFiles.FolderPath); LoadLocalFiles(); } }
public void LoadLocalFiles() { panelLocalFiles.Controls.Clear(); string[] arrLocalFile = ShowLocalFiles(); for (int i = 0; i < arrLocalFile.Length; i++) { uLocalFiles localFiles = new uLocalFiles(); localFiles.FolderPath = arrLocalFile[i]; localFiles.Title = GetTitle(arrLocalFile[i]); panelLocalFiles.Controls.Add(localFiles); localFiles.LocalFiles_Click += LocalFiles_LocalFiles_Click; } }
private void addLocalFiles1_LocalFiles_Click(object sender, EventArgs e) { FolderBrowserDialog folder = new FolderBrowserDialog(); folder.ShowNewFolderButton = false; if (folder.ShowDialog() == DialogResult.OK) { uLocalFiles localFiles = new uLocalFiles(); localFiles.FolderPath = folder.SelectedPath; localFiles.LocalFiles_Click += LocalFiles_LocalFiles_Click; localFiles.Title = GetTitle(folder.SelectedPath); panelLocalFiles.Controls.Add(localFiles); SaveLocalFiles(folder.SelectedPath); } }