diff options
author | Atsushi Kanamori <AtsushiKan@users.noreply.github.com> | 2017-01-18 21:33:07 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-18 21:33:07 +0300 |
commit | 029fc5a4ea9df5622d0a3c71313d82a13c86fe7f (patch) | |
tree | 1720355fa16e3ba1116a423c9c268ee596c3a739 | |
parent | 812448796dce9f0372afecd2d8d4b4d5d1e66e79 (diff) | |
parent | fcddeabd49c36406b561101ae25c23c48a6aa5cd (diff) |
Merge pull request #2533 from AtsushiKan/ac
Adding ISerializable to System.Delegate/System.MulticastDelegate
-rw-r--r-- | src/System.Private.CoreLib/src/System/Delegate.cs | 8 | ||||
-rw-r--r-- | src/System.Private.CoreLib/src/System/MulticastDelegate.cs | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/System.Private.CoreLib/src/System/Delegate.cs b/src/System.Private.CoreLib/src/System/Delegate.cs index 399fd783b..7fa5553cf 100644 --- a/src/System.Private.CoreLib/src/System/Delegate.cs +++ b/src/System.Private.CoreLib/src/System/Delegate.cs @@ -5,6 +5,7 @@ using System.Text; using System.Runtime; using System.Reflection; +using System.Runtime.Serialization; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; using System.Diagnostics; @@ -19,7 +20,7 @@ namespace System // sequential layout directive so that Bartok matches it. [StructLayout(LayoutKind.Sequential)] [DebuggerDisplay("Target method(s) = {GetTargetMethodsDescriptionForDebugger()}")] - public abstract partial class Delegate : ICloneable + public abstract partial class Delegate : ICloneable, ISerializable { // This ctor exists solely to prevent C# from generating a protected .ctor that violates the surface area. I really want this to be a // "protected-and-internal" rather than "internal" but C# has no keyword for the former. @@ -707,6 +708,11 @@ namespace System return MemberwiseClone(); } + public virtual void GetObjectData(SerializationInfo info, StreamingContext context) + { + throw new NotSupportedException(); + } + internal bool IsOpenStatic { get diff --git a/src/System.Private.CoreLib/src/System/MulticastDelegate.cs b/src/System.Private.CoreLib/src/System/MulticastDelegate.cs index 7caec691c..55b550239 100644 --- a/src/System.Private.CoreLib/src/System/MulticastDelegate.cs +++ b/src/System.Private.CoreLib/src/System/MulticastDelegate.cs @@ -3,13 +3,14 @@ // See the LICENSE file in the project root for more information. using System.Diagnostics; +using System.Runtime.Serialization; using System.Runtime.CompilerServices; using Internal.Runtime.CompilerServices; namespace System { - public abstract class MulticastDelegate : Delegate + public abstract class MulticastDelegate : Delegate, ISerializable { // This ctor exists solely to prevent C# from generating a protected .ctor that violates the surface area. I really want this to be a // "protected-and-internal" rather than "internal" but C# has no keyword for the former. @@ -114,5 +115,10 @@ namespace System { return base.GetInvocationList(); } + + public override void GetObjectData(SerializationInfo info, StreamingContext context) + { + throw new NotImplementedException(); + } } } |