private void AddSeletctFolderHander(string folderPath) { if (Directory.Exists(folderPath) && !dirList.Contains(folderPath)) { if (!expander1.IsExpanded) { expander1.IsExpanded = true; } dirList.Add(folderPath); table = null; if (fileListView.DataContext == null) { table = new DataTable("FileList"); table.Columns.Add("Name", typeof(string)); table.Columns.Add("Title", typeof(string)); table.Columns.Add("Artist", typeof(string)); table.Columns.Add("Path", typeof(string)); } else { table = fileListView.DataContext as DataTable; } backgroundWorker.RunWorkerAsync(folderPath); if (waitingWindows == null) { waitingWindows = new WaitingWindow(); } waitingWindows.Owner = this; waitingWindows.ShowDialog(); } }
private void ScanFinish() { fileListView.DataContext = table; searchByDir.IsEnabled = (table.Rows.Count > 1); if (null != waitingWindows) { waitingWindows.canCLose = true; waitingWindows.Close(); waitingWindows = null; } }
private void AddSeletctFolderHander( string folderPath) { if (Directory.Exists(folderPath) && !dirList.Contains(folderPath)) { if (!expander1.IsExpanded) { expander1.IsExpanded = true; } dirList.Add(folderPath); table = null; if (fileListView.DataContext == null) { table = new DataTable("FileList"); table.Columns.Add("Name", typeof(string)); table.Columns.Add("Title", typeof(string)); table.Columns.Add("Artist", typeof(string)); table.Columns.Add("Path", typeof(string)); } else { table = fileListView.DataContext as DataTable; } backgroundWorker.RunWorkerAsync(folderPath); if (waitingWindows == null) { waitingWindows = new WaitingWindow(); } waitingWindows.Owner = this; waitingWindows.ShowDialog(); } }