private void EnumerateFiles() { var dp = (Path as DirectoryInfoEx); if (!_isEnumerationRequired) { return; } _isEnumerationRequired = false; Children.Clear(); if (dp == null) { return; } Children.AddRange(from fsi in dp.GetFileSystemInfos() where _filterAction == null || (!fsi.IsFolder && !(FileExtensionFilter.Contains(fsi.FullName.GetExt()) ^ (bool)_filterAction)) || fsi.IsFolder select new FileTreeViewModel(this, fsi) { _isChecked = _isChecked == true, FileExtensionFilter = FileExtensionFilter, _filterAction = _filterAction }); OnPropertyChanged("IsThreeState"); }
public void Refresh() { if (_isEnumerationRequired) { return; } var dp = (Path as DirectoryInfoEx); if (dp == null) { return; } Children = Children.Intersect(from fsi in dp.GetFileSystemInfos() where _filterAction == null || (!fsi.IsFolder && !(FileExtensionFilter.Contains(fsi.FullName.GetExt()) ^ (bool)_filterAction)) || fsi.IsFolder select new FileTreeViewModel(this, fsi) { _isChecked = _isChecked == true, FileExtensionFilter = FileExtensionFilter, _filterAction = _filterAction }).ToList(); Children.ForEach(m => m.Refresh()); if (IsChecked != null) { SetIsChecked(IsChecked, true, false, true); } else { VerifyCheckState(); } }