예제 #1
0
        //Return all currently visible items
        private IEnumerable <FileSystemEntityViewModel> GetItems(FileSystemEntityViewModel fse)
        {
            var result = new[] { fse };

            if (fse is FileViewModel || fse is ErrorItemViewModel)
            {
                return(result);
            }
            var dvm = (DirectoryViewModel)fse;

            if (!dvm.IsExpanded.Value)
            {
                return(result);
            }
            var children = dvm.Items.Value.SelectMany(x => GetItems(x));

            return(fse == this ? children : result.Concat(children));
        }
예제 #2
0
 //Return all currently visible items
 private IEnumerable<FileSystemEntityViewModel> GetItems(FileSystemEntityViewModel fse) {
     var result = new[] { fse };
     if(fse is FileViewModel || fse is ErrorItemViewModel) return result;
     var dvm = (DirectoryViewModel)fse;
     if(!dvm.IsExpanded.Value) return result;
     var children = dvm.Items.Value.SelectMany(x => GetItems(x));
     return fse == this ? children : result.Concat(children);
 }