2004-01-27 Nick Drochak <ndrochak@ieee.org>
[mono.git] / mcs / class / System / System.IO / FileSystemWatcher.cs
index f7066ea5082ff7050a009a80a87548473c273c72..883c81b76d537e1a94236d52e06e35dd15c141ce 100644 (file)
@@ -30,7 +30,6 @@ namespace System.IO {
                string path;
                string fullpath;
                ISynchronizeInvoke synchronizingObject;
-               bool disposed;
                WaitForChangedResult lastData;
                bool waiting;
                SearchPattern2 pattern;
@@ -86,7 +85,11 @@ namespace System.IO {
                                if (watcher != null)
                                        return;
 
-                               int mode = InternalSupportsFSW ();
+                               string managed = Environment.GetEnvironmentVariable ("MONO_MANAGED_WATCHER");
+                               int mode = 0;
+                               if (managed == null)
+                                       mode = InternalSupportsFSW ();
+
                                bool ok = false;
                                if (mode == 2)
                                        ok = FAMWatcher.GetInstance (out watcher);
@@ -283,7 +286,6 @@ namespace System.IO {
                        if (disposing) {
                                Stop ();
                        }
-                       disposed = true;
                        base.Dispose (disposing);
                }