コード例 #1
0
		void HandleMonoDevelopCoreFileServiceFileRemoved (object sender, FileEventArgs e)
		{
			foreach(var fileInfo in e.ToList())
			{
				if(!fileInfo.IsDirectory)
				{
					MonoDevelop.Core.LoggingService.LogInfo ("File {0} deleted", 
						fileInfo.FileName.FileName);
					client.SendFilePath (fileInfo.FileName, EventType.Delete);
				}
			}
		}
		bool IsPackagesConfigOrProjectJsonFileChanged (FileEventArgs fileEventArgs)
		{
			return fileEventArgs.Any (file => file.FileName.IsPackagesConfigOrProjectJsonFileName ());
		}
		void FileChanged (object sender, FileEventArgs e)
		{
			if (IsPackagesConfigOrProjectJsonFileChanged (e)) {
				RefreshAllChildNodes ();
			}
		}
コード例 #4
0
		void FileChanged (object sender, FileEventArgs e)
		{
			fileChangedEvents.Add (e);
		}
コード例 #5
0
ファイル: FileService.cs プロジェクト: BeeWarloc/monodevelop
 static void OnFileChanged(FileEventArgs args)
 {
     Counters.FileChangeNotifications++;
     eventQueue.RaiseEvent(() => FileChanged, null, args);
 }
コード例 #6
0
        void FileChanged(object sender, FileEventArgs e)
        {
            Solution solution = IdeApp.ProjectOperations.CurrentSelectedSolution;
            if (solution == null)
                return;

            if (!solution.HasDnxProjects ())
                return;

            if (!IsGlobalJsonFileChanged (e))
                return;

            OnSolutionLoaded (solution);
        }
コード例 #7
0
        static bool IsGlobalJsonFileChanged(FileEventArgs e)
        {
            foreach (FileEventInfo fileInfo in e) {
                if (fileInfo.FileName.FileName.Equals ("global.json", StringComparison.OrdinalIgnoreCase)) {
                    return true;
                }
            }

            return false;
        }
コード例 #8
0
		//auto-restore project.json files when they're saved
		void FileChanged (object sender, FileEventArgs e)
		{
			if (PackageManagementServices.BackgroundPackageActionRunner.IsRunning)
				return;

			List<DotNetProject> projects = null;

			//collect all the projects with modified project.json files
			foreach (var eventInfo in e) {
				if (ProjectJsonPathUtilities.IsProjectConfig (eventInfo.FileName)) {
					var directory = eventInfo.FileName.ParentDirectory;
					foreach (var project in IdeApp.Workspace.GetAllItems<DotNetProject> ().Where (p => p.BaseDirectory == directory)) {
						if (projects == null) {
							projects = new List<DotNetProject> ();
						}
						projects.Add (project);
					}
				}
			}

			if (projects == null) {
				return;
			}

			//check that the projects have the correct backing system for project.json
			RefreshProjectsIfNecessary (projects);

			//queue up in a timeout in case this was kicked off from a command
			GLib.Timeout.Add (0, () => {
				if (projects.Count == 1) {
					var project = projects [0];
					//check the project is still open
					if (IdeApp.Workspace.GetAllItems<DotNetProject> ().Any (p => p == project)) {
						RestorePackagesInProjectHandler.Run (projects [0]);
					}
				} else {
					var solution = projects [0].ParentSolution;
					//check the solution is still open
					if (IdeApp.Workspace.GetAllItems<Solution> ().Any (s => s == solution)) {
						RestorePackagesHandler.Run (solution);
					}
				}
				//TODO: handle project.json changing in multiple solutions at once
				return false;
			});
		}
コード例 #9
0
		bool IsPackagesConfigFileChanged (FileEventArgs fileEventArgs)
		{
			return fileEventArgs.Any (file => IsPackagesConfigFileName (file.FileName));
		}
コード例 #10
0
 internal override void OnFileChanged(object source, MonoDevelop.Core.FileEventArgs e)
 {
     base.OnFileChanged(source, e);
     CheckReferenceChange(e.FileName);
 }