void OnFileChanged(object sender, FileEventArgs e) { if (e.Any(info => info.FileName == waitForFileChange)) { fileChangeNotification.TrySetResult(true); } }
void FileService_FileChanged(object sender, FileEventArgs e) { var tcs = fileChangeNotification; if (tcs != null) { if (e.Any(info => info.FileName == waitingForFileNameChange)) { tcs.TrySetResult(null); } } }
void FileServiceOnFileCreated(object sender, FileEventArgs e) { if (directoryToBeCreated.IsNotNull) { if (!e.Any(file => file.FileName == directoryToBeCreated)) { return; } } FileService.FileCreated -= FileServiceOnFileCreated; try { directoryCreatedCompletionSource.SetResult(e); } catch (Exception ex) { directoryCreatedCompletionSource.SetException(ex); } }
void OnSystemFileDeleted(object sender, FileEventArgs args) { if (!args.Any(f => f.IsDirectory)) { return; } // When a folder is deleted, we need to remove all references in the tree, for all projects ITreeBuilder tb = Context.GetTreeBuilder(); var dirs = args.Where(d => d.IsDirectory).Select(d => d.FileName).ToArray(); foreach (var p in IdeApp.Workspace.GetAllProjects()) { foreach (var dir in dirs) { if (tb.MoveToObject(new ProjectFolder(dir, p)) && tb.MoveToParent()) { tb.UpdateAll(); } } } }
void OnSystemFileCreated(object sender, FileEventArgs args) { if (!args.Any(f => f.IsDirectory)) { return; } // When a folder is created, we need to refresh the parent if the folder was created externally. ITreeBuilder tb = Context.GetTreeBuilder(); var dirs = args.Where(d => d.IsDirectory).Select(d => d.FileName).ToArray(); foreach (var p in IdeApp.Workspace.GetAllProjects()) { foreach (var dir in dirs) { if (tb.MoveToObject(new ProjectFolder(dir, p))) { if (tb.MoveToParent()) { tb.UpdateAll(); } } else if (tb.MoveToObject(new ProjectFolder(dir.ParentDirectory, p))) { tb.UpdateAll(); } else if (dir.ParentDirectory == p.BaseDirectory) { if (tb.MoveToObject(p)) { tb.UpdateAll(); } } } } }
bool IsNuGetConfigFileChanged(FileEventArgs e) { return(e.Any(IsNuGetConfigFile)); }
bool IsPackagesConfigOrProjectJsonFileChanged(FileEventArgs fileEventArgs) { return(fileEventArgs.Any(file => file.FileName.IsPackagesConfigOrProjectJsonFileName())); }
void OnSystemFileDeleted (object sender, FileEventArgs args) { if (!args.Any (f => f.IsDirectory)) return; // When a folder is deleted, we need to remove all references in the tree, for all projects ITreeBuilder tb = Context.GetTreeBuilder (); var dirs = args.Where (d => d.IsDirectory).Select (d => d.FileName).ToArray (); foreach (var p in IdeApp.Workspace.GetAllProjects ()) { foreach (var dir in dirs) { if (tb.MoveToObject (new ProjectFolder (dir, p)) && tb.MoveToParent ()) tb.UpdateAll (); } } }
bool IsPackagesConfigFileChanged(FileEventArgs fileEventArgs) { return(fileEventArgs.Any(file => IsPackagesConfigFileName(file.FileName))); }