From 2174a521a3e45f6ce4db967a53edcc1ee2dd0433 Mon Sep 17 00:00:00 2001 From: Marek Safar Date: Wed, 28 Feb 2018 12:46:36 +0100 Subject: Revert "[System.IO] Integrate FileSystemWatchers from CoreFX The FSEvent CoreFX watcher becomes the new default for MacOS." This reverts commit f5b10f34a98bdbbdc0cb086a9240d5a7795ab7c0. --- .../System.IO/CoreFXFileSystemWatcherProxy.cs | 183 --------------- mcs/class/System/System.IO/DefaultWatcher.cs | 11 +- mcs/class/System/System.IO/FAMWatcher.cs | 10 +- mcs/class/System/System.IO/FileSystemWatcher.cs | 100 ++------ mcs/class/System/System.IO/IFileWatcher.cs | 5 +- mcs/class/System/System.IO/InotifyWatcher.cs | 11 +- mcs/class/System/System.IO/KeventWatcher.cs | 11 +- mcs/class/System/System.IO/NullFileWatcher.cs | 9 +- mcs/class/System/System.IO/WaitForChangedResult.cs | 69 ++++++ mcs/class/System/System.IO/WindowsWatcher.cs | 53 +++++ mcs/class/System/System_xtest.dll.sources | 7 - mcs/class/System/basic_System.dll.sources | 2 +- mcs/class/System/build_System.dll.sources | 2 +- mcs/class/System/common.sources | 3 +- mcs/class/System/corefx.unix.sources | 1 - mcs/class/System/corefx/SR.cs | 252 +-------------------- mcs/class/System/darwin_net_4_x_System.dll.sources | 12 - mcs/class/System/linux_net_4_x_System.dll.sources | 16 -- mcs/class/System/net_4_x_System.dll.sources | 6 +- mcs/class/System/win32_net_4_x_System.dll.sources | 11 - mcs/class/System/xammac_net_4_5_System.dll.sources | 2 +- mcs/class/test-helpers/PlatformDetection.cs | 3 +- 22 files changed, 165 insertions(+), 614 deletions(-) delete mode 100644 mcs/class/System/System.IO/CoreFXFileSystemWatcherProxy.cs create mode 100644 mcs/class/System/System.IO/WaitForChangedResult.cs create mode 100644 mcs/class/System/System.IO/WindowsWatcher.cs delete mode 100644 mcs/class/System/corefx.unix.sources delete mode 100644 mcs/class/System/darwin_net_4_x_System.dll.sources delete mode 100644 mcs/class/System/linux_net_4_x_System.dll.sources delete mode 100644 mcs/class/System/win32_net_4_x_System.dll.sources (limited to 'mcs') diff --git a/mcs/class/System/System.IO/CoreFXFileSystemWatcherProxy.cs b/mcs/class/System/System.IO/CoreFXFileSystemWatcherProxy.cs deleted file mode 100644 index 466acd1fff0..00000000000 --- a/mcs/class/System/System.IO/CoreFXFileSystemWatcherProxy.cs +++ /dev/null @@ -1,183 +0,0 @@ -// Bridges the Mono and CoreFX FileSystemWatcher types. - -using System.Collections.Generic; -using System.Collections.Concurrent; -using System.Threading; -using System.Threading.Tasks; -using System.Runtime.CompilerServices; - -using C = System.IO.CoreFX.FileSystemWatcher; -using M = System.IO.FileSystemWatcher; -using Handle = System.Object; - -namespace System.IO { - - internal class CoreFXFileSystemWatcherProxy : IFileWatcher - { - static IFileWatcher instance; // Mono FSW objects -> this - static IDictionary internal_map; // this -> CoreFX FSW objects - static ConditionalWeakTable external_map; // this -> Mono FSW objects - static IDictionary event_map; // CoreFX FSW events -> this - - const int INTERRUPT_MS = 300; - - protected void Operation (Action, ConditionalWeakTable, IDictionary, Handle> map_op = null, Action object_op = null, object handle = null, Action cancel_op = null) - { - C internal_fsw = null; - M fsw = null; - bool live, havelock; - - if (cancel_op != null) { // highest priority and must not lock - havelock = Monitor.TryEnter (instance, INTERRUPT_MS); - live = (handle != null && (internal_map.TryGetValue (handle, out internal_fsw) || external_map.TryGetValue (handle, out fsw))) ; - if (live && havelock) - try { cancel_op (internal_fsw, fsw); } - catch (Exception) { }; - - if (havelock) - Monitor.Exit (instance); - if (live && !havelock) - try { - var t = Task.Run( () => { cancel_op (internal_fsw, fsw); return true;}); - t.Wait (INTERRUPT_MS); - } - catch (Exception) { }; - return; - } - if (map_op != null && handle == null) { - lock (instance) { - try { map_op (internal_map, external_map, event_map, null); } - catch (Exception e) { throw new InvalidOperationException (nameof(map_op), e); } - } - return; - } - - if (handle == null) - return; - - lock (instance) { - live = (internal_map.TryGetValue (handle, out internal_fsw) && external_map.TryGetValue (handle, out fsw)) ; - if (live && map_op != null) { - try { map_op (internal_map, external_map, event_map, handle); } - catch (Exception e) { throw new InvalidOperationException (nameof(map_op), e); }; - } - } - if (!live || object_op == null) - return; - - try { object_op (internal_fsw, fsw); } - catch (Exception e) { throw new InvalidOperationException (nameof(object_op), e); }; - } - - protected void ProxyDispatch (object sender, FileAction action, FileSystemEventArgs args) - { - RenamedEventArgs renamed = - action == FileAction.RenamedNewName ? (RenamedEventArgs) args : null; - - object handle = null; - - Operation (map_op: (in_map, out_map, event_map, h) => event_map.TryGetValue (sender, out handle)); - - Operation (object_op: (_, fsw) => { - if (!fsw.EnableRaisingEvents) - return; - fsw.DispatchEvents (action, args.Name, ref renamed); - if (fsw.Waiting) { - fsw.Waiting = false; - System.Threading.Monitor.PulseAll (fsw); - } - }, handle: handle); - } - - protected void ProxyDispatchError (object sender, ErrorEventArgs args) - { - object handle = null; - - Operation (map_op: (in_map, out_map, event_map, _) => event_map.TryGetValue (sender, out handle)); - - Operation (object_op: (_, fsw) => fsw.DispatchErrorEvents (args), - handle: handle); - } - - public object NewWatcher (M fsw) - { - var handle = new object (); - var result = new C (); - - result.Changed += (object o, FileSystemEventArgs args) => - { ProxyDispatch (o, FileAction.Modified, args); }; - result.Created += (object o, FileSystemEventArgs args) => - { ProxyDispatch (o, FileAction.Added, args); }; - result.Deleted += (object o, FileSystemEventArgs args) => - { ProxyDispatch (o, FileAction.Removed, args); }; - result.Renamed += (object o, RenamedEventArgs args) => - { ProxyDispatch (o, FileAction.RenamedNewName, args); }; - - result.Error += (object o, ErrorEventArgs args) => - { ProxyDispatchError (handle, args); }; - - Operation (map_op: (in_map, out_map, event_map, _) => { - in_map.Add (handle, result); - out_map.Add (handle, fsw); - event_map.Add (result, handle); - }); - - return handle; - } - - public void StartDispatching (object handle) - { - Operation (object_op: (internal_fsw, fsw) => { - internal_fsw.Path = fsw.Path; - internal_fsw.Filter = fsw.Filter; - internal_fsw.IncludeSubdirectories = fsw.IncludeSubdirectories; - internal_fsw.InternalBufferSize = fsw.InternalBufferSize; - internal_fsw.NotifyFilter = fsw.NotifyFilter; - internal_fsw.Site = fsw.Site; - internal_fsw.EnableRaisingEvents = true; - }, handle: handle); - } - - public void StopDispatching (object handle) - { - Operation (handle: handle, - cancel_op: (internal_fsw, fsw) => - { - if (internal_fsw != null) - internal_fsw.EnableRaisingEvents = false; - - }); - } - - public void Dispose (object handle) - { - if (handle == null) - return; - - Operation (handle: handle, - cancel_op: (internal_fsw, fsw) => { - if (internal_fsw != null) - internal_fsw.Dispose (); - var inner_key = internal_map [handle]; - internal_map.Remove (handle); - external_map.Remove (handle); - event_map.Remove (inner_key); - handle = null; - }); - } - - public static bool GetInstance (out IFileWatcher watcher) - { - if (instance != null) { - watcher = instance; - return true; - } - - internal_map = new ConcurrentDictionary (); - external_map = new ConditionalWeakTable (); - event_map = new ConcurrentDictionary (); - instance = watcher = new CoreFXFileSystemWatcherProxy (); - return true; - } - } -} diff --git a/mcs/class/System/System.IO/DefaultWatcher.cs b/mcs/class/System/System.IO/DefaultWatcher.cs index 28186f8451b..cbda2b294aa 100644 --- a/mcs/class/System/System.IO/DefaultWatcher.cs +++ b/mcs/class/System/System.IO/DefaultWatcher.cs @@ -79,9 +79,8 @@ namespace System.IO { return true; } - public void StartDispatching (object handle) + public void StartDispatching (FileSystemWatcher fsw) { - var fsw = handle as FileSystemWatcher; DefaultWatcherData data; lock (this) { if (watches == null) @@ -117,9 +116,8 @@ namespace System.IO { } } - public void StopDispatching (object handle) + public void StopDispatching (FileSystemWatcher fsw) { - var fsw = handle as FileSystemWatcher; DefaultWatcherData data; lock (this) { if (watches == null) return; @@ -134,11 +132,6 @@ namespace System.IO { } } - public void Dispose (object handle) - { - // does nothing - } - void Monitor () { diff --git a/mcs/class/System/System.IO/FAMWatcher.cs b/mcs/class/System/System.IO/FAMWatcher.cs index d0ee6526ee5..63faf5fed7c 100644 --- a/mcs/class/System/System.IO/FAMWatcher.cs +++ b/mcs/class/System/System.IO/FAMWatcher.cs @@ -110,9 +110,8 @@ namespace System.IO { return true; } - public void StartDispatching (object handle) + public void StartDispatching (FileSystemWatcher fsw) { - var fsw = handle as FileSystemWatcher; FAMData data; lock (this) { if (thread == null) { @@ -200,9 +199,8 @@ namespace System.IO { } } - public void StopDispatching (object handle) + public void StopDispatching (FileSystemWatcher fsw) { - var fsw = handle as FileSystemWatcher; FAMData data; lock (this) { data = (FAMData) watches [fsw]; @@ -410,10 +408,6 @@ namespace System.IO { return fam_Pending (ref fc); } - public void Dispose (object handle) - { - // does nothing - } [DllImport ("libfam.so.0", EntryPoint="FAMOpen")] diff --git a/mcs/class/System/System.IO/FileSystemWatcher.cs b/mcs/class/System/System.IO/FileSystemWatcher.cs index c27900524d3..53e31d61f7e 100644 --- a/mcs/class/System/System.IO/FileSystemWatcher.cs +++ b/mcs/class/System/System.IO/FileSystemWatcher.cs @@ -45,8 +45,6 @@ namespace System.IO { #region Fields - bool inited; - bool start_requested; bool enableRaisingEvents; string filter; bool includeSubdirectories; @@ -61,7 +59,6 @@ namespace System.IO { bool disposed; string mangledFilter; static IFileWatcher watcher; - object watcher_handle; static object lockobj = new object (); #endregion // Fields @@ -98,8 +95,6 @@ namespace System.IO { if (!Directory.Exists (path)) throw new ArgumentException ("Directory does not exist", "path"); - this.inited = false; - this.start_requested = false; this.enableRaisingEvents = false; this.filter = filter; this.includeSubdirectories = false; @@ -126,39 +121,28 @@ namespace System.IO { switch (mode) { case 1: // windows ok = DefaultWatcher.GetInstance (out watcher); - watcher_handle = this; + //ok = WindowsWatcher.GetInstance (out watcher); break; case 2: // libfam ok = FAMWatcher.GetInstance (out watcher, false); - watcher_handle = this; break; case 3: // kevent ok = KeventWatcher.GetInstance (out watcher); - watcher_handle = this; break; case 4: // libgamin ok = FAMWatcher.GetInstance (out watcher, true); - watcher_handle = this; break; case 5: // inotify ok = InotifyWatcher.GetInstance (out watcher, true); - watcher_handle = this; - break; - case 6: // CoreFX - ok = CoreFXFileSystemWatcherProxy.GetInstance (out watcher); - watcher_handle = (watcher as CoreFXFileSystemWatcherProxy).NewWatcher (this); break; } if (mode == 0 || !ok) { if (String.Compare (managed, "disabled", true) == 0) NullFileWatcher.GetInstance (out watcher); - else { + else DefaultWatcher.GetInstance (out watcher); - watcher_handle = this; - } } - this.inited = true; ShowWatcherInfo (); } @@ -189,6 +173,9 @@ namespace System.IO { return mangledFilter; string filterLocal = "*.*"; + if (!(watcher.GetType () == typeof (WindowsWatcher))) + filterLocal = "*"; + return filterLocal; } } @@ -223,12 +210,6 @@ namespace System.IO { public bool EnableRaisingEvents { get { return enableRaisingEvents; } set { - if (disposed) - throw new ObjectDisposedException (GetType().Name); - - start_requested = true; - if (!inited) - return; if (value == enableRaisingEvents) return; // Do nothing @@ -237,7 +218,6 @@ namespace System.IO { Start (); } else { Stop (); - start_requested = false; } } } @@ -252,7 +232,7 @@ namespace System.IO { if (value == null || value == "") value = "*.*"; - if (!string.Equals(filter, value, PathInternal.StringComparison)) { + if (filter != value) { filter = value; pattern = null; mangledFilter = null; @@ -284,8 +264,8 @@ namespace System.IO { if (internalBufferSize == value) return; - if (value < 4096) - value = 4096; + if (value < 4196) + value = 4196; internalBufferSize = value; if (enableRaisingEvents) { @@ -319,11 +299,7 @@ namespace System.IO { public string Path { get { return path; } set { - if (disposed) - throw new ObjectDisposedException (GetType().Name); - - value = (value == null) ? string.Empty : value; - if (string.Equals(path, value, PathInternal.StringComparison)) + if (path == value) return; bool exists = false; @@ -336,10 +312,10 @@ namespace System.IO { } if (exc != null) - throw new ArgumentException(SR.Format(SR.InvalidDirName, value), nameof(Path)); + throw new ArgumentException ("Invalid directory name", "value", exc); if (!exists) - throw new ArgumentException(SR.Format(SR.InvalidDirName_NotExists, value), nameof(Path)); + throw new ArgumentException ("Directory does not exist", "value"); path = value; fullpath = null; @@ -353,12 +329,7 @@ namespace System.IO { [Browsable(false)] public override ISite Site { get { return base.Site; } - set - { - base.Site = value; - if (Site != null && Site.DesignMode) - this.EnableRaisingEvents = true; - } + set { base.Site = value; } } [DefaultValue(null)] @@ -376,41 +347,27 @@ namespace System.IO { public void BeginInit () { // Not necessary in Mono - // but if called, EndInit() must be called - inited = false; } protected override void Dispose (bool disposing) { - if (disposed) - return; - - try { - watcher.StopDispatching (watcher_handle); - watcher.Dispose (watcher_handle); - } catch (Exception) { } - - watcher_handle = null; - watcher = null; + if (!disposed) { + disposed = true; + Stop (); + } - disposed = true; base.Dispose (disposing); - GC.SuppressFinalize (this); } ~FileSystemWatcher () { - if (disposed) - return; - - Dispose (false); + disposed = true; + Stop (); } public void EndInit () { - inited = true; - if (start_requested) - this.EnableRaisingEvents = true; + // Not necessary in Mono } enum EventType { @@ -427,13 +384,13 @@ namespace System.IO { foreach (var target in ev.GetInvocationList()) { switch (evtype) { case EventType.RenameEvent: - ((RenamedEventHandler)target).Invoke (this, (RenamedEventArgs)arg); + ((RenamedEventHandler)target).BeginInvoke (this, (RenamedEventArgs)arg, null, null); break; case EventType.ErrorEvent: - ((ErrorEventHandler)target).Invoke (this, (ErrorEventArgs)arg); + ((ErrorEventHandler)target).BeginInvoke (this, (ErrorEventArgs)arg, null, null); break; case EventType.FileSystemEvent: - ((FileSystemEventHandler)target).Invoke (this, (FileSystemEventArgs)arg); + ((FileSystemEventHandler)target).BeginInvoke (this, (FileSystemEventArgs)arg, null, null); break; } } @@ -546,20 +503,12 @@ namespace System.IO { void Start () { - if (disposed) - return; - if (watcher_handle == null) - return; - watcher.StartDispatching (watcher_handle); + watcher.StartDispatching (this); } void Stop () { - if (disposed) - return; - if (watcher_handle == null) - return; - watcher.StopDispatching (watcher_handle); + watcher.StopDispatching (this); } #endregion // Methods @@ -588,7 +537,6 @@ namespace System.IO { /* 3 -> Kevent */ /* 4 -> gamin */ /* 5 -> inotify */ - /* 6 -> CoreFX */ [MethodImplAttribute(MethodImplOptions.InternalCall)] static extern int InternalSupportsFSW (); } diff --git a/mcs/class/System/System.IO/IFileWatcher.cs b/mcs/class/System/System.IO/IFileWatcher.cs index d7e6055a1d5..7ed4878fa6d 100644 --- a/mcs/class/System/System.IO/IFileWatcher.cs +++ b/mcs/class/System/System.IO/IFileWatcher.cs @@ -30,9 +30,8 @@ namespace System.IO { interface IFileWatcher { - void StartDispatching (object fsw); - void StopDispatching (object fsw); - void Dispose (object fsw); + void StartDispatching (FileSystemWatcher fsw); + void StopDispatching (FileSystemWatcher fsw); } } diff --git a/mcs/class/System/System.IO/InotifyWatcher.cs b/mcs/class/System/System.IO/InotifyWatcher.cs index 8668533ff83..fe023429a0c 100644 --- a/mcs/class/System/System.IO/InotifyWatcher.cs +++ b/mcs/class/System/System.IO/InotifyWatcher.cs @@ -133,9 +133,8 @@ namespace System.IO { return true; } - public void StartDispatching (object handle) + public void StartDispatching (FileSystemWatcher fsw) { - var fsw = handle as FileSystemWatcher; ParentInotifyData parent; lock (this) { if ((long) FD == -1) @@ -329,9 +328,8 @@ namespace System.IO { } } - public void StopDispatching (object handle) + public void StopDispatching (FileSystemWatcher fsw) { - var fsw = handle as FileSystemWatcher; ParentInotifyData parent; lock (this) { parent = (ParentInotifyData) watches [fsw]; @@ -610,11 +608,6 @@ namespace System.IO { return AddWatch (fd, directory, mask); } - public void Dispose (object handle) - { - // does nothing - } - [DllImport ("libc", EntryPoint="close")] internal extern static int Close (IntPtr fd); diff --git a/mcs/class/System/System.IO/KeventWatcher.cs b/mcs/class/System/System.IO/KeventWatcher.cs index 5a1984f7099..778671764ea 100644 --- a/mcs/class/System/System.IO/KeventWatcher.cs +++ b/mcs/class/System/System.IO/KeventWatcher.cs @@ -736,9 +736,8 @@ namespace System.IO { return true; } - public void StartDispatching (object handle) + public void StartDispatching (FileSystemWatcher fsw) { - var fsw = handle as FileSystemWatcher; KqueueMonitor monitor; if (watches.ContainsKey (fsw)) { @@ -751,20 +750,14 @@ namespace System.IO { monitor.Start (); } - public void StopDispatching (object handle) + public void StopDispatching (FileSystemWatcher fsw) { - var fsw = handle as FileSystemWatcher; KqueueMonitor monitor = (KqueueMonitor)watches [fsw]; if (monitor == null) return; monitor.Stop (); } - - public void Dispose (object handle) - { - // does nothing - } [DllImport ("libc")] extern static int close (int fd); diff --git a/mcs/class/System/System.IO/NullFileWatcher.cs b/mcs/class/System/System.IO/NullFileWatcher.cs index ea1cbccfaee..33f314f55b8 100644 --- a/mcs/class/System/System.IO/NullFileWatcher.cs +++ b/mcs/class/System/System.IO/NullFileWatcher.cs @@ -35,17 +35,12 @@ namespace System.IO { static IFileWatcher instance; - public void StartDispatching (object handle) + public void StartDispatching (FileSystemWatcher fsw) { // does nothing } - public void StopDispatching (object handle) - { - // does nothing - } - - public void Dispose (object handle) + public void StopDispatching (FileSystemWatcher fsw) { // does nothing } diff --git a/mcs/class/System/System.IO/WaitForChangedResult.cs b/mcs/class/System/System.IO/WaitForChangedResult.cs new file mode 100644 index 00000000000..7a6765b1e07 --- /dev/null +++ b/mcs/class/System/System.IO/WaitForChangedResult.cs @@ -0,0 +1,69 @@ +// +// System.IO.WaitForChangedResult.cs +// +// Author: +// Tim Coleman (tim@timcoleman.com) +// +// Copyright (C) Tim Coleman, 2002 +// + +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; + +namespace System.IO { + public struct WaitForChangedResult { + + #region Fields + + WatcherChangeTypes changeType; + string name; + string oldName; + bool timedOut; + + #endregion // Fields + + #region Properties + + public WatcherChangeTypes ChangeType { + get { return changeType; } + set { changeType = value; } + } + + public string Name { + get { return name; } + set { name = value; } + } + + public string OldName { + get { return oldName; } + set { oldName = value; } + } + + public bool TimedOut { + get { return timedOut; } + set { timedOut = value; } + } + + #endregion // Properties + } +} diff --git a/mcs/class/System/System.IO/WindowsWatcher.cs b/mcs/class/System/System.IO/WindowsWatcher.cs new file mode 100644 index 00000000000..dc5e848f13d --- /dev/null +++ b/mcs/class/System/System.IO/WindowsWatcher.cs @@ -0,0 +1,53 @@ +// +// System.IO.WindowsWatcher.cs: windows IFileWatcher +// +// Authors: +// Gonzalo Paniagua Javier (gonzalo@ximian.com) +// +// (c) 2004 Novell, Inc. (http://www.novell.com) +// + +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +namespace System.IO { + class WindowsWatcher : IFileWatcher + { + private WindowsWatcher () + { + } + + // Locked by caller + public static bool GetInstance (out IFileWatcher watcher) + { + throw new NotSupportedException (); + } + + public void StartDispatching (FileSystemWatcher fsw) + { + } + + public void StopDispatching (FileSystemWatcher fsw) + { + } + } +} + diff --git a/mcs/class/System/System_xtest.dll.sources b/mcs/class/System/System_xtest.dll.sources index da81fa878ab..40c357e00c8 100644 --- a/mcs/class/System/System_xtest.dll.sources +++ b/mcs/class/System/System_xtest.dll.sources @@ -92,10 +92,3 @@ System/RemoteExecutorTests.cs ../../../external/corefx/src/Common/src/System/Net/UriScheme.cs ../../../external/corefx/src/Common/src/System/SerializableAttribute.cs ../../../external/corefx/src/Common/tests/System/ShouldNotBeInvokedException.cs - -# System.IO.FileSystemWatcher -../../../external/corefx/src/System.IO.FileSystem.Watcher/tests/Utility/*.cs -../../../external/corefx/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.cs -../../../external/corefx/src/System.IO.FileSystem.Watcher/tests/FileSystemWatcher.unit.cs -../../../external/corefx/src/Common/tests/System/IO/TempFile.cs -../../../external/corefx/src/Common/tests/System/IO/TempDirectory.cs diff --git a/mcs/class/System/basic_System.dll.sources b/mcs/class/System/basic_System.dll.sources index ba79dd85fc1..ee2d1a0d962 100644 --- a/mcs/class/System/basic_System.dll.sources +++ b/mcs/class/System/basic_System.dll.sources @@ -1,2 +1,2 @@ #include net_4_x_System.dll.sources -../../../external/corefx/src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.UnknownUnix.cs + diff --git a/mcs/class/System/build_System.dll.sources b/mcs/class/System/build_System.dll.sources index ba79dd85fc1..ee2d1a0d962 100644 --- a/mcs/class/System/build_System.dll.sources +++ b/mcs/class/System/build_System.dll.sources @@ -1,2 +1,2 @@ #include net_4_x_System.dll.sources -../../../external/corefx/src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.UnknownUnix.cs + diff --git a/mcs/class/System/common.sources b/mcs/class/System/common.sources index 90911c364ca..785ea5e3513 100644 --- a/mcs/class/System/common.sources +++ b/mcs/class/System/common.sources @@ -1,6 +1,5 @@ Assembly/AssemblyInfo.cs ../../build/common/SR.cs -corefx/SR.cs corefx/ZLibNative.cs @@ -40,6 +39,7 @@ System.IO/IODescriptionAttribute.cs System.IO/NotifyFilters.cs System.IO/RenamedEventArgs.cs System.IO/RenamedEventHandler.cs +System.IO/WaitForChangedResult.cs System.IO/WatcherChangeTypes.cs System.Net/BasicClient.cs @@ -928,4 +928,3 @@ corefx/SR.cs ../../../external/corefx/src/System.Private.Uri/src/System/UriBuilder.cs ../../../external/corefx/src/System.Runtime.Extensions/src/System/CodeDom/Compiler/IndentedTextWriter.cs -../../../external/corefx/src/System.IO.FileSystem.Watcher/src/System/IO/WaitForChangedResult.cs diff --git a/mcs/class/System/corefx.unix.sources b/mcs/class/System/corefx.unix.sources deleted file mode 100644 index bec78d856d3..00000000000 --- a/mcs/class/System/corefx.unix.sources +++ /dev/null @@ -1 +0,0 @@ -../../../external/corefx/src/Common/src/Interop/Unix/*.cs diff --git a/mcs/class/System/corefx/SR.cs b/mcs/class/System/corefx/SR.cs index 720825e4b91..d83dc9b8691 100644 --- a/mcs/class/System/corefx/SR.cs +++ b/mcs/class/System/corefx/SR.cs @@ -46,257 +46,6 @@ partial class SR public const string PartitionerStatic_CurrentCalledBeforeMoveNext = "MoveNext must be called at least once before calling Current."; public const string ConcurrentBag_Enumerator_EnumerationNotStartedOrAlreadyFinished = "Enumeration has either not started or has already finished."; public const string Arg_KeyNotFoundWithKey = "The given key '{0}' was not present in the dictionary."; - public const string IO_FileExists_Name = "The file '{0}' already exists."; - public const string IO_FileName_Name = "File name: '{0}'"; - public const string IO_FileNotFound = "Unable to find the specified file."; - public const string IO_FileNotFound_FileName = "Could not load file or assembly '{0}'. The system cannot find the file specified."; - public const string IO_FileLoad = "Could not load the specified file."; - public const string IO_NoPermissionToDirectoryName = " false; } -} \ No newline at end of file +} -- cgit v1.2.3