internal void Folders(string path) { foreach (var p in FindObjects.FindFolders(path)) { var files = FindObjects.FindFiles(p.path); foreach (var t in files) { CheckedElements.Add(t); } Folders(p.path); } }
private void Button_SelectAll(object sender, RoutedEventArgs e) { for (int i = 0; i < Elements.Count; i++) { if (Elements[i].type == "file") { Elements[i].isSelected = true; CheckedElements.Add(Elements[i]); } } ElementList.ItemsSource = null; ElementList.ItemsSource = Elements; }
private void CheckBox_Checked(object sender, RoutedEventArgs e) { if (((Element)((CheckBox)sender).DataContext).type == "file") { CheckedElements.Add((Element)((CheckBox)sender).DataContext); } else { var files = FindObjects.FindFiles(((Element)((CheckBox)sender).DataContext).path); foreach (var t in files) { CheckedElements.Add(t); CheckedElements[CheckedElements.Count - 1].isSelected = true; } Folders((((Element)((CheckBox)sender).DataContext).path)); } }