private IIncrementalHierarchyBuilder CreateIncrementalBuilder(FileSystemTree fileSystemTree) { var vsHierarchy = _hierarchy as VsHierarchy; if (vsHierarchy != null) { return(new IncrementalHierarchyBuilder( _nodeTemplateFactory, vsHierarchy, fileSystemTree, _imageSourceFactory)); } var vsHierarchyAggregate = _hierarchy as VsHierarchyAggregate; if (vsHierarchyAggregate != null) { return(new IncrementalHierarchyBuilderAggregate( _nodeTemplateFactory, vsHierarchyAggregate, fileSystemTree, _imageSourceFactory)); } Debug.Assert(false); return(null); }
private void FileSystemTreeSource_OnTreeReceived(FileSystemTree fileSystemTree) { WpfUtilities.Post(_control, () => { ViewModel.ServerIsRunning = true; OnFileSystemTreeScanSuccess(fileSystemTree); }); }
private void OnFileSystemTreeScanSuccess(FileSystemTree tree) { ViewModel.FileSystemTreeAvailable = (tree.Projects.Count > 0); _currentFileSystemTreeVersion = tree.Version; if (ViewModel.FileSystemTreeAvailable) { var items = CreateInfromationMessages( "No search results available - Type text to search for " + "in the \"Search Code\" or \"File Paths\" text box."); ViewModel.SetInformationMessagesNoActivate(items); if (ViewModel.ActiveDisplay == CodeSearchViewModel.DisplayKind.InformationMessages) { _searchResultDocumentChangeTracker.Disable(); ViewModel.SwitchToInformationMessages(); } RefreshView(tree.Version); FetchDatabaseStatistics(); } else { var items = CreateInfromationMessages( "Open a source file from a local Chromium enlistment or" + "\r\n" + string.Format("from a directory containing a \"{0}\" file.", ConfigurationFileNames.ProjectFileName)); ViewModel.SetInformationMessagesNoActivate(items); _searchResultDocumentChangeTracker.Disable(); ViewModel.SwitchToInformationMessages(); FetchDatabaseStatistics(); } }
private void AssertTreeIsEmpty(FileSystemTree tree) { Assert.IsNotNull(tree.Root); Assert.IsNotNull(tree.Root.Name); Assert.AreEqual("", tree.Root.Name); Assert.IsNotNull(tree.Root.Entries); Assert.AreEqual(0, tree.Root.Entries.Count); }
/// <summary> /// News the file command. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="ExecutedRoutedEventArgs"/> instance containing the event data.</param> private void NewFileCommand(object sender, ExecutedRoutedEventArgs e) { var p = FileSystemTree.SelectedPath; var filename = Path.Combine(p, "NewFile"); File.WriteAllText(filename, ""); FileSystemTree.UpdateView(); }
private IIncrementalHierarchyBuilder CreateIncrementalBuilder(FileSystemTree fileSystemTree) { return(new IncrementalHierarchyBuilderAggregate( _nodeTemplateFactory, _hierarchy, fileSystemTree, _nodeViewModelLoader, _imageSourceFactory)); }
private void PostApplyFileSystemTreeToVsHierarchy(FileSystemTree fileSystemTree) { _delayedOperationExecutor.Post( new DelayedOperation { Id = "ApplyFileSystemTreeToVsHierarchy", Action = () => ApplyFileSystemTreeToVsHierarchy(fileSystemTree), Delay = TimeSpan.FromSeconds(0.1), }); }
public void GivenThereIsBobRepositoryClonedIntoDirectory(string directory) { FileSystemTree tree = new FileSystemTree(directory) { new FileSystemFile("Bob.2013.Community.sln") }; this.core.Storage.Register(tree); }
public void SetFileSystemTree(FileSystemTree tree) { _fileSystemEntryRootNodes = tree.Root .Entries .Select(x => FileSystemEntryViewModel.Create(_sourceExplorerViewModelHost, null, x)) .ToList(); ExpandNodes(_fileSystemEntryRootNodes, false); SwitchToFileSystemTree(); }
protected virtual void OnTreeReceived(FileSystemTree obj) { var handler = TreeReceived; if (handler != null) { handler(obj); } }
/// <summary> /// Note: This is executed on a background thred. /// </summary> private void OnTreeReceived(FileSystemTree fileSystemTree) { if (!_globalSettingsProvider.GlobalSettings.EnableSourceExplorerHierarchy) { return; } _latestFileSystemTreeVersion = fileSystemTree.Version; PostApplyFileSystemTreeToVsHierarchy(fileSystemTree); }
FileSystemTree GetDiferent(FileSystemTree otherTree, Diferent flags) { if (_root.Name != otherTree._root.Name) { return this; } FileSystemTree returnTree = new FileSystemTree(_root.Name) {_root = GetDiferent(_root, otherTree._root, flags)}; return returnTree; }
private void OnFileSystemTreeScanSuccess(FileSystemTree tree) { if (_cachedSearchPattern != null) { FileSearch(_cachedSearchPattern); _cachedSearchPattern = null; } _currentFileSystemTreeVersion = tree.Version; RefreshView(tree.Version); }
public IncrementalHierarchyBuilderAggregate( INodeTemplateFactory nodeTemplateFactory, VsHierarchyAggregate hierarchy, FileSystemTree fileSystemTree, IImageSourceFactory imageSourceFactory) { _templateFactory = nodeTemplateFactory; _hierarchy = hierarchy; _fileSystemTree = fileSystemTree; _imageSourceFactory = imageSourceFactory; }
public void GivenThereIsNetJsonRepositoryClonedIntoDirectory(string directory) { FileSystemTree tree = new FileSystemTree(directory) { new FileSystemFile("NetJSON.sln"), new FileSystemDirectory("NetJSON"), new FileSystemDirectory("NetJSON.V3_5"), new FileSystemDirectory("NetJSON.Tests") }; this.core.Storage.Register(tree); }
public IncrementalHierarchyBuilder( INodeTemplateFactory nodeTemplateFactory, VsHierarchy hierarchy, FileSystemTree fileSystemTree, IImageSourceFactory imageSourceFactory) { _templateFactory = nodeTemplateFactory; _hierarchy = hierarchy; _oldNodes = hierarchy.Nodes; _fileSystemTree = fileSystemTree; _imageSourceFactory = imageSourceFactory; }
public void GivenThereIsNpgsqlRepositoryAlreadyCompiledInDirectory(string directory) { FileSystemTree tree = new FileSystemTree(directory) { new FileSystemFile("Npgsql.dll"), new FileSystemFile("Npgsql.pdb"), new FileSystemFile("Npgsql.xml"), new FileSystemFile("Npgsql.Tests.dll"), new FileSystemFile("Npgsql.Tests.pdb") }; this.core.Storage.Register(tree); }
private void ApplyFileSystemTreeToVsHierarchy(FileSystemTree fileSystemTree) { var builder = CreateIncrementalBuilder(fileSystemTree); var applyChanges = builder.ComputeChangeApplier(); _synchronizationContextProvider.DispatchThreadContext.Post(() => { var result = applyChanges(_latestFileSystemTreeVersion); if (result == ApplyChangesResult.Retry) { PostApplyFileSystemTreeToVsHierarchy(fileSystemTree); } }); }
public void GivenThereIsBobRepositoryAlreadyCompiledInDirectory(string directory) { FileSystemTree tree = new FileSystemTree(directory) { new FileSystemFile("Bob.exe"), new FileSystemFile("Bob.pdb"), new FileSystemFile("Microsoft.CodeAnalysis.dll"), new FileSystemFile("Microsoft.CodeAnalysis.xml"), new FileSystemFile("Microsoft.CodeAnalysis.CSharp.dll"), new FileSystemFile("Microsoft.CodeAnalysis.CSharp.xml") }; this.core.Storage.Register(tree); }
protected virtual void Dispose(bool disposing) { if (FileSystemTree != null) { FileSystemTree.Dispose(); } if (FocusedTreeNode != null) { FocusedTreeNode.Tree.Dispose(); } if (_SearchTreeInstance != null) { _SearchTreeInstance.Dispose(); } }
public void GivenThereIsBobRepositoryAlreadyRestoredInDirectory(string directory) { FileSystemTree tree = new FileSystemTree(directory) { new FileSystemDirectory("NUnit.2.6.4"), new FileSystemDirectory("SpecFlow.1.9.0"), new FileSystemDirectory("ilrepack.1.26.0") { new FileSystemDirectory("tools") { new FileSystemFile("ILRepack.exe") } } }; this.core.Storage.Register(tree); }
public void GivenThereIsNpgsqlRepositoryClonedIntoDirectory(string directory) { FileSystemTree tree = new FileSystemTree(directory) { new FileSystemFile("Npgsql2010.sln"), new FileSystemFile("Npgsql2012.sln"), new FileSystemFile("Npgsql2013.sln"), new FileSystemDirectory(".nuget") { new FileSystemFile("NuGet.exe") }, new FileSystemDirectory("Npgsql.EntityFramework"), new FileSystemDirectory("Npgsql"), new FileSystemDirectory("NpgsqlDdexProvider"), new FileSystemDirectory("Tools"), new FileSystemDirectory("packages"), new FileSystemFile("template.nuspec") }; this.core.Storage.Register(tree); }
public void GivenThereIsNpgsqlRepositoryAlreadyRestoredInDirectory(string directory) { FileSystemTree tree = new FileSystemTree(directory) { new FileSystemDirectory("NUnit.2.6.4") { new FileSystemDirectory("lib") { new FileSystemFile("nunit.framework.dll") } }, new FileSystemDirectory("NUnit.Runners.2.6.4") { new FileSystemDirectory("tools") { new FileSystemFile("nunit-console.exe") } } }; this.core.Storage.Register(tree); }
private void StartNewSearch(string request, SearchTree.SearchType searchType, bool considerContent, bool caseSensetive, bool isRegularExpression) { while (SearchTreeInstance.IsSearching) { SearchTreeInstance.EndSearch(); } SetSearchArguments(request, searchType, considerContent, caseSensetive, isRegularExpression); if (!(FocusedTreeNode is SearchNode)) { directoryBeforeSearch = new SFMDirectory(FocusedTreeNode.Value.ElementPath); if (!FileSystemTree.Contains(FocusedTreeNode)) { FocusedTreeNode.Tree.Dispose(); } } FocusedTreeNode.DisposeObservableCollections(); FocusedTreeNode = SearchTreeInstance.Root; SearchTreeInstance.StartSearch(); }
public AdvancedQueueXmlWorker(XmlWorkerParameters workerParameters) : base(workerParameters) { _tree = new FileSystemTree(); }
protected virtual void OnTreeReceived(FileSystemTree obj) { TreeReceived?.Invoke(obj); }
private IEnumerable <RootEntry> CreateRootEntries(List <VsHierarchy> oldHierarchies) { foreach (var hierarchy in oldHierarchies) { var rootPath = GetHierarchyRootPath(hierarchy); var directoryEntry = _fileSystemTree.Root.Entries.FirstOrDefault(x => x.Name == rootPath); if (directoryEntry == null) { // Hierarchy should be deleted, as its root does not exist in new tree var fakeTree = new FileSystemTree { Version = _fileSystemTree.Version, Root = new DirectoryEntry() { Name = _fileSystemTree.Root.Name, Entries = new List <FileSystemEntry>() } }; yield return(new RootEntry { RootPath = rootPath, FileSystemTree = fakeTree, Hierarchy = hierarchy, Builder = new IncrementalHierarchyBuilder(_templateFactory, hierarchy, fakeTree, _imageSourceFactory) }); } else { // Hierarchy should be updated with new root entry var fakeTree = new FileSystemTree { Version = _fileSystemTree.Version, Root = new DirectoryEntry() { Name = _fileSystemTree.Root.Name, Entries = new List <FileSystemEntry> { directoryEntry } } }; yield return(new RootEntry { RootPath = rootPath, FileSystemTree = fakeTree, Hierarchy = hierarchy, Builder = new IncrementalHierarchyBuilder(_templateFactory, hierarchy, fakeTree, _imageSourceFactory) }); } } // Look for new hierarchies foreach (var directoryEntry in _fileSystemTree.Root.Entries) { var rootPath = directoryEntry.Name; var hierarchy = oldHierarchies.FirstOrDefault(x => GetHierarchyRootPath(x) == rootPath); if (hierarchy == null) { // A new hierarchy should be created var fakeTree = new FileSystemTree { Version = _fileSystemTree.Version, Root = new DirectoryEntry() { Name = _fileSystemTree.Root.Name, Entries = new List <FileSystemEntry> { directoryEntry } } }; var newHierarchy = _hierarchy.CreateHierarchy(); yield return(new RootEntry { RootPath = rootPath, FileSystemTree = fakeTree, Hierarchy = newHierarchy, Builder = new IncrementalHierarchyBuilder(_templateFactory, newHierarchy, fakeTree, _imageSourceFactory) }); } } }
public MainWindowViewModel() { Tree = new FileSystemTree(); }
public static FileSystemTree GetFileSystemTree(string root) { FileSystemTree returnNode = new FileSystemTree(root); returnNode.CreateTree(returnNode._root); return returnNode; }
private void FileSystemTreeSource_OnTreeReceived(FileSystemTree fileSystemTree) { WpfUtilities.Post(this, () => { Controller.OnFileSystemTreeComputed(fileSystemTree); }); }
public static FileSystemTree GetDiferent(FileSystemTree first, FileSystemTree second, Diferent flags ) { FileSystemTree returnTree = new FileSystemTree( first._root.Name.FullName ); return returnTree.GetDiferent( second, flags ); }
private void FileSystemTreeSource_OnTreeReceived(FileSystemTree fileSystemTree) { WpfUtilities.Post(_control, () => { OnFileSystemTreeScanSuccess(fileSystemTree); }); }