Example #1
0
 void OnFileChanged(object sender, FileEventArgs e)
 {
     if (e.Any(info => info.FileName == waitForFileChange))
     {
         fileChangeNotification.TrySetResult(true);
     }
 }
Example #2
0
        void FileService_FileChanged(object sender, FileEventArgs e)
        {
            var tcs = fileChangeNotification;

            if (tcs != null)
            {
                if (e.Any(info => info.FileName == waitingForFileNameChange))
                {
                    tcs.TrySetResult(null);
                }
            }
        }
Example #3
0
        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);
            }
        }
Example #4
0
        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();
                    }
                }
            }
        }
Example #5
0
        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();
                        }
                    }
                }
            }
        }
Example #6
0
 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)));
 }