Пример #1
0
 public Task UpdateFullPathAsync(ProjectWriteLockReleaser access, CancellationToken cancellationToken = default(CancellationToken)) {
     _inMemoryImportFullPath = _unconfiguredProject.GetInMemoryTargetsFileFullPath();
     _inMemoryImport.FullPath = _inMemoryImportFullPath;
     return ReevaluateLoadedConfiguredProjects(cancellationToken, access);
 }
Пример #2
0
        private Task RenameItems(Dictionary<string, ProjectItemElement> items, string oldDirectoryName, string newDirectoryName, ProjectWriteLockReleaser access) {
            var itemsToRename = items.Keys
                .Where(f => f.StartsWithIgnoreCase(oldDirectoryName))
                .ToDictionary(f => f, f => newDirectoryName + f.Substring(oldDirectoryName.Length));

            return RenameItems(items, itemsToRename, access);
        }
Пример #3
0
 private async Task RenameItems(Dictionary<string, ProjectItemElement> items, IReadOnlyDictionary<string, string> itemsToRename, ProjectWriteLockReleaser access) {
     await access.CheckoutAsync(itemsToRename.Keys);
     foreach (var kvp in itemsToRename) {
         ProjectItemElement item;
         if (items.TryGetValue(kvp.Key, out item)) {
             items.Remove(kvp.Key);
             item.Include = kvp.Value;
             items[kvp.Value] = item;
         }
     }
 }
Пример #4
0
 private Task RenameFiles(IReadOnlyDictionary<string, string> filesToRename, ProjectWriteLockReleaser access) {
     return RenameItems(_fileItems, filesToRename, access);
 }
Пример #5
0
 private async Task RenameDirectories(IReadOnlyDictionary<string, string> directoriesToRename, ProjectWriteLockReleaser access) {
     foreach (var kvp in directoriesToRename) {
         await RenameItems(_fileItems, kvp.Key, kvp.Value, access);
         await RenameItems(_directoryItems, kvp.Key, kvp.Value, access);
     }
 }
Пример #6
0
 private async Task RemoveItems(ProjectItemGroupElement parent, Dictionary<string, ProjectItemElement> items, IReadOnlyCollection<string> itemsToRemove, ProjectWriteLockReleaser access) {
     await access.CheckoutAsync(itemsToRemove);
     foreach (var path in itemsToRemove) {
         RemoveItem(parent, items, path);
     }
 }
Пример #7
0
 private Task RemoveItems(ProjectItemGroupElement parent, Dictionary<string, ProjectItemElement> items, string directoryName, ProjectWriteLockReleaser access) {
     return RemoveItems(parent, items, items.Keys.Where(f => f.StartsWithIgnoreCase(directoryName)).ToList(), access);
 }
Пример #8
0
 private async Task RemoveDirectories(IReadOnlyCollection<string> directoriesToRemove, ProjectWriteLockReleaser access) {
     foreach (var directoryName in directoriesToRemove) {
         await RemoveItems(_filesItemGroup, _fileItems, directoryName, access);
         await RemoveItems(_directoriesItemGroup, _directoryItems, directoryName, access);
     }
 }
Пример #9
0
 private Task RemoveFiles(HashSet<string> filesToRemove, ProjectWriteLockReleaser access) {
     return RemoveItems(_filesItemGroup, _fileItems, filesToRemove, access);
 }
Пример #10
0
 private async Task ReevaluateLoadedConfiguredProjects(CancellationToken cancellationToken, ProjectWriteLockReleaser access) {
     foreach (var configuredProject in _unconfiguredProject.LoadedConfiguredProjects) {
         try {
             var jsproj = await access.GetProjectAsync(configuredProject, cancellationToken);
             jsproj.ReevaluateIfNecessary();
         } catch (Exception ex) {
             System.Diagnostics.Debug.Fail("We were unable to mark a configuration as dirty" + ex.Message, ex.StackTrace);
         }
     }
 }