private async void RepositoryManager_FilesChanged(object sender, GitFilesUpdateEventArgs e) { try { await TaskScheduler.Default; await ProcessMultiFileChange((GitRepository)sender, e); } catch (Exception ex) { Debug.WriteLine("Error in RepositoryManager_FilesChanged: " + ex.Message); } }
private async Task ProcessMultiFileChange(GitRepository repo, GitFilesUpdateEventArgs e) { //lock (_glyphsLock) //{ HashSet <IVsSccProject2> nodes = new HashSet <IVsSccProject2>(); foreach (var file in e.Files) { var items = _fileCache.GetProjectsSelectionForFile(file); if (items != null) { foreach (var vsitemselection in items) { nodes.Add(vsitemselection); } } } if (nodes.Count > 0) { Debug.WriteLine("Updating Multiple Files"); await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); foreach (var project in nodes) { project.SccGlyphChanged(0, null, null, null); } } //todo maybe move this var caption = "Solution Explorer"; string branch = await GetCurrentBranchNameAsync(); if (!string.IsNullOrEmpty(branch)) { caption += " (" + branch + ")"; SetSolutionExplorerTitle(caption); } // } }
private void FireFilesChangedEvent(object sender, GitFilesUpdateEventArgs e) { _onFilesUpdateEventHandler?.Invoke(sender, e); }
private void Repo_FilesChanged(object sender, GitFilesUpdateEventArgs e) { FireFilesChangedEvent(sender, e); }
private async void CurrentTracker_FilesChanged(object sender, GitFilesUpdateEventArgs e) { await Refresh(); }
private async Task ProcessMultiFileChange(GitRepository repo, GitFilesUpdateEventArgs e) { //lock (_glyphsLock) //{ HashSet<IVsSccProject2> nodes = new HashSet<IVsSccProject2>(); foreach (var file in e.Files) { var items = _fileCache.GetProjectsSelectionForFile(file); if (items != null) { foreach (var vsitemselection in items) { nodes.Add(vsitemselection); } } } if (nodes.Count > 0) { Debug.WriteLine("Updating Multiple Files"); await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); foreach (var project in nodes) { project.SccGlyphChanged(0, null, null, null); } } //todo maybe move this var caption = "Solution Explorer"; string branch = await GetCurrentBranchNameAsync(); if (!string.IsNullOrEmpty(branch)) { caption += " (" + branch + ")"; SetSolutionExplorerTitle(caption); } // } }
private async void RepositoryManager_FilesChanged(object sender, GitFilesUpdateEventArgs e) { try { await TaskScheduler.Default; await ProcessMultiFileChange((GitRepository) sender, e); } catch (Exception ex) { Debug.WriteLine("Error in RepositoryManager_FilesChanged: " + ex.Message); } }