From d42935cafb2ad48db167dc654fe2582919501b3e Mon Sep 17 00:00:00 2001 From: Marius Ungureanu Date: Wed, 28 Aug 2019 15:20:23 +0300 Subject: [PATCH 1/3] Use the right FileSystemWatcher sources The corefx code for FileSystemEventArgs has some changes to support constructing one with a null filename. Fixes #16486 --- mcs/class/System/common.sources | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mcs/class/System/common.sources b/mcs/class/System/common.sources index 180612aa20de..d60215c68ca9 100644 --- a/mcs/class/System/common.sources +++ b/mcs/class/System/common.sources @@ -29,8 +29,6 @@ System.IO.Compression/DeflateStream.cs System.IO/ErrorEventArgs.cs System.IO/ErrorEventHandler.cs -System.IO/FileSystemEventArgs.cs -System.IO/FileSystemEventHandler.cs System.IO/InternalBufferOverflowException.cs System.IO/InvalidDataException.cs System.IO/IODescriptionAttribute.cs @@ -865,6 +863,9 @@ ReferenceSources/Win32Exception.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/FileSystemEventArgs.cs +../../../external/corefx/src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemEventHandler.cs +../../../external/corefx/src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.cs ../../../external/corefx/src/System.IO.FileSystem.Watcher/src/System/IO/WaitForChangedResult.cs ../../../external/corefx/src/System.Runtime.InteropServices/src/System/Security/SecureStringMarshal.cs @@ -872,7 +873,6 @@ ReferenceSources/Win32Exception.cs ../../../external/corefx/src/System.Diagnostics.StackTrace/src/System/Diagnostics/StackFrameExtensions.cs ../../../external/corefx/src/System.IO.FileSystem/src/System/IO/Enumeration/FileSystemName.cs -../../../external/corefx/src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.cs # Everything except compiled ../../../external/corefx/src/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Capture.cs From 6c1f328c0310e59a90f07be35e032434889bd86e Mon Sep 17 00:00:00 2001 From: Marius Ungureanu Date: Wed, 28 Aug 2019 15:21:25 +0300 Subject: [PATCH 2/3] Remove the mono sources for the newly replaced files --- .../System/System.IO/FileSystemEventArgs.cs | 75 ------------------- .../System.IO/FileSystemEventHandler.cs | 33 -------- 2 files changed, 108 deletions(-) delete mode 100644 mcs/class/System/System.IO/FileSystemEventArgs.cs delete mode 100644 mcs/class/System/System.IO/FileSystemEventHandler.cs diff --git a/mcs/class/System/System.IO/FileSystemEventArgs.cs b/mcs/class/System/System.IO/FileSystemEventArgs.cs deleted file mode 100644 index ef7e7ed0d7ea..000000000000 --- a/mcs/class/System/System.IO/FileSystemEventArgs.cs +++ /dev/null @@ -1,75 +0,0 @@ -// -// System.IO.FileSystemEventArgs.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 class FileSystemEventArgs : EventArgs { - - #region Fields - - WatcherChangeTypes changeType; - string directory; - string name; - - #endregion // Fields - - #region Constructors - - public FileSystemEventArgs (WatcherChangeTypes changeType, string directory, string name) - { - this.changeType = changeType; - this.directory = directory; - this.name = name; - } - - internal void SetName (string name) - { - this.name = name; - } - #endregion // Constructors - - #region Properties - - public WatcherChangeTypes ChangeType { - get { return changeType; } - } - - public string FullPath { - get { return Path.Combine (directory, name); } - } - - public string Name { - get { return name; } - } - - #endregion // Properties - } -} diff --git a/mcs/class/System/System.IO/FileSystemEventHandler.cs b/mcs/class/System/System.IO/FileSystemEventHandler.cs deleted file mode 100644 index 16b0ad0cb0c6..000000000000 --- a/mcs/class/System/System.IO/FileSystemEventHandler.cs +++ /dev/null @@ -1,33 +0,0 @@ -// -// System.IO.FileSystemEventHandler.cs -// -// Author: -// Tim Coleman (tim@timcoleman.com) -// -// Copyright (C) Tim Coleman, 2002 -// Copyright (C) 2006 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 { - - public delegate void FileSystemEventHandler (object sender, FileSystemEventArgs e); -} From 1c51606dfcb67df60b965d66aab479573e1aa912 Mon Sep 17 00:00:00 2001 From: monojenkins Date: Thu, 29 Aug 2019 11:03:55 +0000 Subject: [PATCH 3/3] [csproj] Update project files --- mcs/class/System/System.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mcs/class/System/System.csproj b/mcs/class/System/System.csproj index 04efd76cb342..d5510e8dd4b2 100644 --- a/mcs/class/System/System.csproj +++ b/mcs/class/System/System.csproj @@ -405,6 +405,8 @@ + + @@ -859,8 +861,6 @@ - -