Author: lluis
Date: 2008-01-21 11:17:19 -0500 (Mon, 21 Jan 2008)
New Revision: 93405

Modified:
   trunk/monodevelop/main/src/core/MonoDevelop.Projects/ChangeLog
   
trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects/CombineEntry.cs
   
trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects/Project.cs
Log:
* MonoDevelop.Projects/CombineEntry.cs: Notify changes in project
  files.
* MonoDevelop.Projects/Project.cs: Use the file service to track
  changes in files.

Modified: trunk/monodevelop/main/src/core/MonoDevelop.Projects/ChangeLog
===================================================================
--- trunk/monodevelop/main/src/core/MonoDevelop.Projects/ChangeLog      
2008-01-21 16:07:39 UTC (rev 93404)
+++ trunk/monodevelop/main/src/core/MonoDevelop.Projects/ChangeLog      
2008-01-21 16:17:19 UTC (rev 93405)
@@ -1,3 +1,9 @@
+2008-01-21  Lluis Sanchez Gual <[EMAIL PROTECTED]> 
+
+       * MonoDevelop.Projects/CombineEntry.cs: Notify changes in project files.
+       * MonoDevelop.Projects/Project.cs: Use the file service to track 
changes in
+         files.
+
 2008-01-18  Lluis Sanchez Gual <[EMAIL PROTECTED]> 
 
        * MonoDevelop.Projects.Parser/ClassEntry.cs: Removed unused property.

Modified: 
trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects/CombineEntry.cs
===================================================================
--- 
trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects/CombineEntry.cs
   2008-01-21 16:07:39 UTC (rev 93404)
+++ 
trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects/CombineEntry.cs
   2008-01-21 16:17:19 UTC (rev 93405)
@@ -176,6 +176,7 @@
                                Services.ProjectService.ExtensionChain.Save 
(monitor, this);
                                OnSaved (thisCombineArgs);
                                lastSaveTime = GetLastWriteTime ();
+                               FileService.NotifyFileChanged (FileName);
                        } finally {
                                savingFlag = false;
                        }

Modified: 
trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects/Project.cs
===================================================================
--- 
trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects/Project.cs
        2008-01-21 16:07:39 UTC (rev 93404)
+++ 
trunk/monodevelop/main/src/core/MonoDevelop.Projects/MonoDevelop.Projects/Project.cs
        2008-01-21 16:17:19 UTC (rev 93405)
@@ -65,16 +65,13 @@
                
                bool isDirty = false;
                
-               private FileSystemWatcher projectFileWatcher;
-               
                public Project ()
                {
                        Name = "New Project";
                        projectReferences = new ProjectReferenceCollection ();
                        projectReferences.SetProject (this);
                        
-                       projectFileWatcher = new FileSystemWatcher();
-                       projectFileWatcher.Changed += new 
FileSystemEventHandler (OnFileChanged);
+                       FileService.FileChanged += OnFileChanged;
                }
                
                [DefaultValue("")]
@@ -265,12 +262,10 @@
                
                public override void Dispose()
                {
-                       base.Dispose ();
-                       projectFileWatcher.Changed -= new 
FileSystemEventHandler (OnFileChanged);
-                       projectFileWatcher.Dispose ();
                        foreach (ProjectFile file in ProjectFiles) {
                                file.Dispose ();
                        }
+                       base.Dispose ();
                }
                
                public ProjectReference AddReference (string filename)
@@ -488,8 +483,6 @@
                        }
                        set {
                                base.FileName = value;
-                               if (value != null)
-                                       UpdateFileWatch ();
                        }
                }
                
@@ -542,16 +535,9 @@
                        else return finfo.LastWriteTime;
                }
 
-               private void UpdateFileWatch()
+               void OnFileChanged (object source, FileEventArgs e)
                {
-                       projectFileWatcher.EnableRaisingEvents = false;
-                       projectFileWatcher.Path = BaseDirectory;
-                       projectFileWatcher.EnableRaisingEvents = true;
-               }
-               
-               void OnFileChanged (object source, FileSystemEventArgs e)
-               {
-                       ProjectFile file = GetProjectFile (e.FullPath);
+                       ProjectFile file = GetProjectFile (e.FileName);
                        if (file != null) {
                                isDirty = true;
                                try {

_______________________________________________
Mono-patches maillist  -  Mono-patches@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to