You've already forked linux-packaging-mono
Imported Upstream version 5.14.0.78
Former-commit-id: 3494343bcc9ddb42b36b82dd9ae7b69e85e0229f
This commit is contained in:
parent
74b74abd9f
commit
19234507ba
@@ -1,4 +1,4 @@
|
||||
TypeForwarders.cs
|
||||
AssemblyInfo.cs
|
||||
|
||||
RegistryAclExtensions.cs
|
||||
../../../../external/corefx/src/Microsoft.Win32.Registry.AccessControl/src/Microsoft/Win32/RegistryAclExtensions.cs
|
||||
|
@@ -1,63 +0,0 @@
|
||||
//
|
||||
// RegistryAclExtensions.cs
|
||||
//
|
||||
// Author:
|
||||
// Alexander Köplinger (alexander.koeplinger@xamarin.com)
|
||||
//
|
||||
// (C) 2016 Xamarin, Inc.
|
||||
//
|
||||
|
||||
//
|
||||
// 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;
|
||||
using System.Security;
|
||||
using System.Security.AccessControl;
|
||||
|
||||
namespace Microsoft.Win32
|
||||
{
|
||||
public static class RegistryAclExtensions
|
||||
{
|
||||
public static RegistrySecurity GetAccessControl (this RegistryKey key)
|
||||
{
|
||||
if (key == null)
|
||||
throw new ArgumentNullException (nameof (key));
|
||||
|
||||
return key.GetAccessControl ();
|
||||
}
|
||||
|
||||
public static RegistrySecurity GetAccessControl (this RegistryKey key, AccessControlSections includeSections)
|
||||
{
|
||||
if (key == null)
|
||||
throw new ArgumentNullException (nameof (key));
|
||||
|
||||
return key.GetAccessControl (includeSections);
|
||||
}
|
||||
|
||||
public static void SetAccessControl (this RegistryKey key, RegistrySecurity registrySecurity)
|
||||
{
|
||||
if (key == null)
|
||||
throw new ArgumentNullException (nameof (key));
|
||||
|
||||
key.SetAccessControl (registrySecurity);
|
||||
}
|
||||
}
|
||||
}
|
@@ -14,6 +14,8 @@ SIGN_FLAGS = /delaysign /nowarn:1616,1699
|
||||
LIB_REFS = System
|
||||
LIB_MCS_FLAGS = $(SIGN_FLAGS)
|
||||
|
||||
PLATFORM_DEBUG_FLAGS =
|
||||
|
||||
NO_TEST = yes
|
||||
|
||||
include $(MCS_BUILD_DIR)/library.make
|
||||
|
@@ -1,91 +0,0 @@
|
||||
//
|
||||
// StackFrameExtensions.cs
|
||||
//
|
||||
// Author:
|
||||
// Alexander Köplinger (alexander.koeplinger@xamarin.com)
|
||||
//
|
||||
// (C) 2016 Xamarin, Inc.
|
||||
//
|
||||
|
||||
//
|
||||
// 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.Diagnostics
|
||||
{
|
||||
public static class StackFrameExtensions
|
||||
{
|
||||
[MonoTODO]
|
||||
public static IntPtr GetNativeImageBase (this StackFrame stackFrame)
|
||||
{
|
||||
if (stackFrame == null)
|
||||
throw new ArgumentNullException (nameof (stackFrame));
|
||||
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public static IntPtr GetNativeIP (this StackFrame stackFrame)
|
||||
{
|
||||
if (stackFrame == null)
|
||||
throw new ArgumentNullException (nameof (stackFrame));
|
||||
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public static bool HasNativeImage (this StackFrame stackFrame)
|
||||
{
|
||||
if (stackFrame == null)
|
||||
throw new ArgumentNullException (nameof (stackFrame));
|
||||
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public static bool HasMethod (this StackFrame stackFrame)
|
||||
{
|
||||
if (stackFrame == null)
|
||||
throw new ArgumentNullException (nameof (stackFrame));
|
||||
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public static bool HasILOffset (this StackFrame stackFrame)
|
||||
{
|
||||
if (stackFrame == null)
|
||||
throw new ArgumentNullException (nameof (stackFrame));
|
||||
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
|
||||
[MonoTODO]
|
||||
public static bool HasSource (this StackFrame stackFrame)
|
||||
{
|
||||
if (stackFrame == null)
|
||||
throw new ArgumentNullException (nameof (stackFrame));
|
||||
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,5 +1,2 @@
|
||||
TypeForwarders.cs
|
||||
AssemblyInfo.cs
|
||||
|
||||
../../../build/common/MonoTODOAttribute.cs
|
||||
StackFrameExtensions.cs
|
||||
|
@@ -21,6 +21,7 @@
|
||||
//
|
||||
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.StackFrame))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.StackFrameExtensions))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.StackTrace))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.SymbolStore.ISymbolBinder))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Diagnostics.SymbolStore.ISymbolBinder1))]
|
||||
|
@@ -14,6 +14,8 @@ SIGN_FLAGS = /delaysign /nowarn:1616,1699
|
||||
LIB_REFS = System
|
||||
LIB_MCS_FLAGS = $(SIGN_FLAGS)
|
||||
|
||||
PLATFORM_DEBUG_FLAGS =
|
||||
|
||||
NO_TEST = yes
|
||||
|
||||
include $(MCS_BUILD_DIR)/library.make
|
||||
|
@@ -1,4 +0,0 @@
|
||||
partial class SR
|
||||
{
|
||||
public const string Argument_InvalidFlag = "Value of flags is invalid.";
|
||||
}
|
@@ -1,6 +1,2 @@
|
||||
TypeForwarders.cs
|
||||
AssemblyInfo.cs
|
||||
|
||||
SR.cs
|
||||
../../../../external/corefx/src/System.Runtime.Extensions/src/System/Globalization/Extensions.cs
|
||||
../../../../external/corefx/src/System.Runtime.Extensions/src/System/StringNormalizationExtensions.cs
|
||||
|
@@ -20,5 +20,7 @@
|
||||
// THE SOFTWARE.
|
||||
//
|
||||
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Globalization.GlobalizationExtensions))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Globalization.IdnMapping))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.StringNormalizationExtensions))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Text.NormalizationForm))]
|
||||
|
@@ -1,101 +0,0 @@
|
||||
//
|
||||
// FileSystemAclExtensions.cs
|
||||
//
|
||||
// Author:
|
||||
// Alexander Köplinger (alexander.koeplinger@xamarin.com)
|
||||
//
|
||||
// (C) 2016 Xamarin, Inc.
|
||||
//
|
||||
|
||||
//
|
||||
// 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.Security.AccessControl;
|
||||
|
||||
namespace System.IO
|
||||
{
|
||||
public static class FileSystemAclExtensions
|
||||
{
|
||||
public static DirectorySecurity GetAccessControl(this DirectoryInfo directoryInfo)
|
||||
{
|
||||
if (directoryInfo == null)
|
||||
throw new ArgumentNullException (nameof (directoryInfo));
|
||||
|
||||
return directoryInfo.GetAccessControl ();
|
||||
}
|
||||
|
||||
public static DirectorySecurity GetAccessControl(this DirectoryInfo directoryInfo, AccessControlSections includeSections)
|
||||
{
|
||||
if (directoryInfo == null)
|
||||
throw new ArgumentNullException (nameof (directoryInfo));
|
||||
|
||||
return directoryInfo.GetAccessControl (includeSections);
|
||||
}
|
||||
|
||||
public static FileSecurity GetAccessControl(this FileInfo fileInfo)
|
||||
{
|
||||
if (fileInfo == null)
|
||||
throw new ArgumentNullException (nameof (fileInfo));
|
||||
|
||||
return fileInfo.GetAccessControl ();
|
||||
}
|
||||
|
||||
public static FileSecurity GetAccessControl(this FileInfo fileInfo, AccessControlSections includeSections)
|
||||
{
|
||||
if (fileInfo == null)
|
||||
throw new ArgumentNullException (nameof (fileInfo));
|
||||
|
||||
return fileInfo.GetAccessControl (includeSections);
|
||||
}
|
||||
|
||||
public static FileSecurity GetAccessControl(this FileStream fileStream)
|
||||
{
|
||||
if (fileStream == null)
|
||||
throw new ArgumentNullException (nameof (fileStream));
|
||||
|
||||
return fileStream.GetAccessControl ();
|
||||
}
|
||||
|
||||
public static void SetAccessControl(this DirectoryInfo directoryInfo, DirectorySecurity directorySecurity)
|
||||
{
|
||||
if (directoryInfo == null)
|
||||
throw new ArgumentNullException (nameof (directoryInfo));
|
||||
|
||||
directoryInfo.SetAccessControl (directorySecurity);
|
||||
}
|
||||
|
||||
public static void SetAccessControl(this FileInfo fileInfo, FileSecurity fileSecurity)
|
||||
{
|
||||
if (fileInfo == null)
|
||||
throw new ArgumentNullException (nameof (fileInfo));
|
||||
|
||||
fileInfo.SetAccessControl (fileSecurity);
|
||||
}
|
||||
|
||||
public static void SetAccessControl(this FileStream fileStream, FileSecurity fileSecurity)
|
||||
{
|
||||
if (fileStream == null)
|
||||
throw new ArgumentNullException (nameof (fileStream));
|
||||
|
||||
fileStream.SetAccessControl (fileSecurity);
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,5 +1,4 @@
|
||||
TypeForwarders.cs
|
||||
AssemblyInfo.cs
|
||||
|
||||
../../../build/common/MonoTODOAttribute.cs
|
||||
FileSystemAclExtensions.cs
|
||||
../../../../external/corefx/src/System.IO.FileSystem.AccessControl/src/System/IO/FileSystemAclExtensions.net46.cs
|
||||
|
@@ -1,136 +0,0 @@
|
||||
//
|
||||
// DynamicMethod.cs
|
||||
//
|
||||
// Authors:
|
||||
// Marek Safar (marek.safar@gmail.com)
|
||||
//
|
||||
// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.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.
|
||||
//
|
||||
|
||||
#if FULL_AOT_RUNTIME
|
||||
|
||||
namespace System.Reflection.Emit
|
||||
{
|
||||
public abstract class DynamicMethod : MethodInfo, ICustomAttributeProvider
|
||||
{
|
||||
public DynamicMethod (string name, Type returnType, Type[] parameterTypes)
|
||||
{
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
public DynamicMethod (string name, Type returnType, Type[] parameterTypes, bool restrictedSkipVisibility)
|
||||
{
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
public DynamicMethod (string name, Type returnType, Type[] parameterTypes, Module m)
|
||||
{
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
public DynamicMethod (string name, Type returnType, Type[] parameterTypes, Type owner)
|
||||
{
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
public DynamicMethod (string name, Type returnType, Type[] parameterTypes, Module m, bool skipVisibility)
|
||||
{
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
public DynamicMethod (string name, Type returnType, Type[] parameterTypes, Type owner, bool skipVisibility)
|
||||
{
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
public DynamicMethod (string name, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] parameterTypes, Module m, bool skipVisibility)
|
||||
{
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
public DynamicMethod (string name, MethodAttributes attributes, CallingConventions callingConvention, Type returnType, Type[] parameterTypes, Type owner, bool skipVisibility)
|
||||
{
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
public override MethodAttributes Attributes {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public override CallingConventions CallingConvention {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public override Type DeclaringType {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public bool InitLocals { get; set; }
|
||||
|
||||
public override MethodImplAttributes MethodImplementationFlags {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public override string Name {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public override ParameterInfo ReturnParameter {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public override Type ReturnType {
|
||||
get {
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
|
||||
public ILGenerator GetILGenerator ()
|
||||
{
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
public ILGenerator GetILGenerator (int streamSize)
|
||||
{
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
|
||||
public override ParameterInfo[] GetParameters ()
|
||||
{
|
||||
throw new PlatformNotSupportedException ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
@@ -1,3 +1,2 @@
|
||||
TypeForwarders.cs
|
||||
AssemblyInfo.cs
|
||||
DynamicMethod.cs
|
||||
|
@@ -20,6 +20,4 @@
|
||||
// THE SOFTWARE.
|
||||
//
|
||||
|
||||
#if !FULL_AOT_RUNTIME
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.Emit.DynamicMethod))]
|
||||
#endif
|
||||
|
@@ -1,3 +1,3 @@
|
||||
AssemblyInfo.cs
|
||||
AssemblyExtensions.cs
|
||||
AssemblyLoadContext.cs
|
||||
TypeForwarders.cs
|
||||
|
@@ -1,10 +1,5 @@
|
||||
//
|
||||
// AssemblyExtensions.cs
|
||||
//
|
||||
// Authors:
|
||||
// Marek Safar <marek.safar@gmail.com>
|
||||
//
|
||||
// Copyright (C) 2016 Xamarin Inc (http://www.xamarin.com)
|
||||
// Copyright (C) 2018 Microsoft Corporation (http://www.microsoft.com)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining
|
||||
// a copy of this software and associated documentation files (the
|
||||
@@ -13,10 +8,10 @@
|
||||
// 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
|
||||
@@ -26,14 +21,4 @@
|
||||
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
|
||||
|
||||
namespace System.Reflection.Metadata
|
||||
{
|
||||
public static class AssemblyExtensions
|
||||
{
|
||||
public static unsafe bool TryGetRawMetadata (this System.Reflection.Assembly assembly, out byte* blob, out int length)
|
||||
{
|
||||
throw new NotImplementedException ();
|
||||
}
|
||||
}
|
||||
}
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Reflection.Metadata.AssemblyExtensions))]
|
@@ -1,4 +1,2 @@
|
||||
TypeForwarders.cs
|
||||
AssemblyInfo.cs
|
||||
|
||||
../../../../external/corefx/src/System.Runtime.Serialization.Primitives/src/System/Runtime/Serialization/ISerializationSurrogateProvider.cs
|
||||
|
@@ -30,6 +30,7 @@
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.IExtensibleDataObject))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.IgnoreDataMemberAttribute))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.InvalidDataContractException))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.ISerializationSurrogateProvider))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.KnownTypeAttribute))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.OnDeserializedAttribute))]
|
||||
[assembly: System.Runtime.CompilerServices.TypeForwardedToAttribute(typeof(System.Runtime.Serialization.OnDeserializingAttribute))]
|
||||
|
@@ -1,84 +0,0 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
#if !NO_CODEDOM
|
||||
using System.CodeDom;
|
||||
#endif
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Reflection;
|
||||
|
||||
namespace System.Runtime.Serialization
|
||||
{
|
||||
public static class DataContractSerializerExtensions
|
||||
{
|
||||
public static ISerializationSurrogateProvider GetSerializationSurrogateProvider(this DataContractSerializer serializer)
|
||||
{
|
||||
SurrogateProviderAdapter adapter = serializer.DataContractSurrogate as SurrogateProviderAdapter;
|
||||
return (adapter == null) ? null : adapter.Provider;
|
||||
}
|
||||
|
||||
public static void SetSerializationSurrogateProvider(this DataContractSerializer serializer, ISerializationSurrogateProvider provider)
|
||||
{
|
||||
// allocate every time, expectation is that this won't happen enough to warrant maintaining a CondtionalWeakTable.
|
||||
IDataContractSurrogate adapter = new SurrogateProviderAdapter(provider);
|
||||
|
||||
// DCS doesn't expose a setter, access the field directly as a workaround
|
||||
typeof(DataContractSerializer)
|
||||
.GetField("dataContractSurrogate", BindingFlags.Instance | BindingFlags.NonPublic)
|
||||
.SetValue(serializer, adapter);
|
||||
}
|
||||
|
||||
private class SurrogateProviderAdapter : IDataContractSurrogate
|
||||
{
|
||||
private ISerializationSurrogateProvider _provider;
|
||||
public SurrogateProviderAdapter(ISerializationSurrogateProvider provider)
|
||||
{
|
||||
_provider = provider;
|
||||
}
|
||||
|
||||
public ISerializationSurrogateProvider Provider { get { return _provider; } }
|
||||
public object GetCustomDataToExport(Type clrType, Type dataContractType)
|
||||
{
|
||||
throw NotImplemented.ByDesign;
|
||||
}
|
||||
|
||||
public object GetCustomDataToExport(MemberInfo memberInfo, Type dataContractType)
|
||||
{
|
||||
throw NotImplemented.ByDesign;
|
||||
}
|
||||
|
||||
public Type GetDataContractType(Type type)
|
||||
{
|
||||
return _provider.GetSurrogateType(type);
|
||||
}
|
||||
|
||||
public object GetDeserializedObject(object obj, Type targetType)
|
||||
{
|
||||
return _provider.GetDeserializedObject(obj, targetType);
|
||||
}
|
||||
|
||||
public void GetKnownCustomDataTypes(Collection<Type> customDataTypes)
|
||||
{
|
||||
throw NotImplemented.ByDesign;
|
||||
}
|
||||
|
||||
public object GetObjectToSerialize(object obj, Type targetType)
|
||||
{
|
||||
return _provider.GetObjectToSerialize(obj, targetType);
|
||||
}
|
||||
|
||||
public Type GetReferencedTypeOnImport(string typeName, string typeNamespace, object customData)
|
||||
{
|
||||
throw NotImplemented.ByDesign;
|
||||
}
|
||||
|
||||
#if !NO_CODEDOM
|
||||
public CodeTypeDeclaration ProcessImportedType(CodeTypeDeclaration typeDeclaration, CodeCompileUnit compileUnit)
|
||||
{
|
||||
throw NotImplemented.ByDesign;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user