Beispiel #1
0
        private List <TreeViewItemViewModel> CreateSearchFilePathsResult(
            FilePathSearchInfo searchInfo,
            DirectoryEntry fileResults,
            string description,
            string additionalWarning,
            bool expandAll)
        {
            Action <FileSystemEntryViewModel> setLineColumn = entry => {
                var fileEntry = entry as FileEntryViewModel;
                if (fileEntry != null && searchInfo.LineNumber >= 0)
                {
                    fileEntry.SetLineColumn(searchInfo.LineNumber, searchInfo.ColumnNumber);
                }
            };

            var rootNode = new RootTreeViewItemViewModel(StandarImageSourceFactory);
            var result   = Enumerable
                           .Empty <TreeViewItemViewModel>()
                           .ConcatSingle(new TextItemViewModel(StandarImageSourceFactory, rootNode, description))
                           .ConcatSingle(new TextWarningItemViewModel(StandarImageSourceFactory, rootNode, additionalWarning), () => !string.IsNullOrEmpty(additionalWarning))
                           .Concat(fileResults.Entries.Select(x => FileSystemEntryViewModel.Create(this, rootNode, x, setLineColumn)))
                           .ToList();

            result.ForAll(rootNode.AddChild);
            TreeViewItemViewModel.ExpandNodes(result, expandAll);
            return(result);
        }
Beispiel #2
0
        /// <summary>
        /// Navigate to the FileSystemTree directory entry corresponding to
        /// <paramref name="relativePathEntry"/>. This is a no-op if the FileSystemTree
        /// is already the currently active ViewModel.
        /// </summary>
        public void ShowInSourceExplorer(FileSystemEntryViewModel relativePathEntry)
        {
            var path = relativePathEntry.GetFullPath();

            _eventBus.PostEvent(EventNames.SolutionExplorer.ShowFile, relativePathEntry, new FilePathEventArgs {
                FilePath = path
            });
        }
Beispiel #3
0
        /// <summary>
        /// Navigate to the FileSystemTree directory entry corresponding to
        /// <paramref name="relativePathEntry"/>. This is a no-op if the FileSystemTree
        /// is already the currently active ViewModel.
        /// </summary>
        public void ShowInSourceExplorer(FileSystemEntryViewModel relativePathEntry)
        {
            var path = relativePathEntry.GetFullPath();

            _eventBus.Fire("ShowInSolutionExplorer", relativePathEntry, new FilePathEventArgs {
                FilePath = path
            });
        }
Beispiel #4
0
        private List <TreeViewItemViewModel> CreateSearchCodeResultViewModel(DirectoryEntry searchResults, string description, bool expandAll)
        {
            var rootNode = new RootTreeViewItemViewModel(StandarImageSourceFactory);
            var result   =
                new List <TreeViewItemViewModel> {
                new TextItemViewModel(StandarImageSourceFactory, rootNode, description)
            }
            .Concat(searchResults.Entries.Select(x => FileSystemEntryViewModel.Create(this, rootNode, x, _ => { })))
            .ToList();

            result.ForAll(rootNode.AddChild);
            TreeViewItemViewModel.ExpandNodes(result, expandAll);
            return(result);
        }
Beispiel #5
0
        private List <TreeViewItemViewModel> CreateSearchCodeResultViewModel(
            DirectoryEntry searchResults,
            string description,
            string additionalWarning,
            bool expandAll)
        {
            var rootNode = new RootTreeViewItemViewModel(StandarImageSourceFactory);
            var result   = Enumerable
                           .Empty <TreeViewItemViewModel>()
                           .ConcatSingle(new TextItemViewModel(StandarImageSourceFactory, rootNode, description))
                           .ConcatSingle(new TextWarningItemViewModel(StandarImageSourceFactory, rootNode, additionalWarning), () => !string.IsNullOrEmpty(additionalWarning))
                           .Concat(searchResults.Entries.Select(x => FileSystemEntryViewModel.Create(this, rootNode, x, _ => { })))
                           .ToList();

            result.ForAll(rootNode.AddChild);
            TreeViewItemViewModel.ExpandNodes(result, expandAll);
            return(result);
        }