summaryrefslogtreecommitdiff
path: root/src/mscorlib/src/System/Runtime/Serialization
diff options
context:
space:
mode:
Diffstat (limited to 'src/mscorlib/src/System/Runtime/Serialization')
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/FormatterConverter.cs3
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/FormatterServices.cs480
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/IDeserializationCallback.cs1
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/IFormatter.cs41
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/IFormatterConverter.cs1
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/IObjectReference.cs2
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/ISerializable.cs2
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/ISerializationSurrogate.cs34
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/ISurrogateSelector.cs34
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/MemberHolder.cs51
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/SafeSerializationManager.cs210
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/SerializationAttributes.cs5
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/SerializationBinder.cs29
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/SerializationException.cs1
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/SerializationFieldInfo.cs136
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/SerializationInfo.cs59
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/SerializationInfoEnumerator.cs2
-rw-r--r--src/mscorlib/src/System/Runtime/Serialization/StreamingContext.cs2
18 files changed, 3 insertions, 1090 deletions
diff --git a/src/mscorlib/src/System/Runtime/Serialization/FormatterConverter.cs b/src/mscorlib/src/System/Runtime/Serialization/FormatterConverter.cs
index b710ed0..27f7ecf 100644
--- a/src/mscorlib/src/System/Runtime/Serialization/FormatterConverter.cs
+++ b/src/mscorlib/src/System/Runtime/Serialization/FormatterConverter.cs
@@ -17,8 +17,7 @@ namespace System.Runtime.Serialization {
using System.Globalization;
using System.Diagnostics.Contracts;
-[System.Runtime.InteropServices.ComVisible(true)]
- public class FormatterConverter : IFormatterConverter {
+ internal class FormatterConverter : IFormatterConverter {
public FormatterConverter() {
}
diff --git a/src/mscorlib/src/System/Runtime/Serialization/FormatterServices.cs b/src/mscorlib/src/System/Runtime/Serialization/FormatterServices.cs
index 27c3f15..c3f9eb4 100644
--- a/src/mscorlib/src/System/Runtime/Serialization/FormatterServices.cs
+++ b/src/mscorlib/src/System/Runtime/Serialization/FormatterServices.cs
@@ -18,10 +18,6 @@ namespace System.Runtime.Serialization {
using System.Collections;
using System.Collections.Generic;
using System.Security;
- using System.Security.Permissions;
-#if FEATURE_SERIALIZATION
- using System.Runtime.Serialization.Formatters;
-#endif
using System.Runtime.Remoting;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
@@ -32,211 +28,7 @@ namespace System.Runtime.Serialization {
using System.Diagnostics;
using System.Diagnostics.Contracts;
- [System.Runtime.InteropServices.ComVisible(true)]
public static class FormatterServices {
-#if FEATURE_SERIALIZATION
- internal static Dictionary<MemberHolder, MemberInfo[]> m_MemberInfoTable = new Dictionary<MemberHolder, MemberInfo[]>(32);
- private static bool unsafeTypeForwardersIsEnabled = false;
-
- private static volatile bool unsafeTypeForwardersIsEnabledInitialized = false;
-
- private static Object s_FormatterServicesSyncObject = null;
-
- private static Object formatterServicesSyncObject
- {
- get
- {
- if (s_FormatterServicesSyncObject == null)
- {
- Object o = new Object();
- Interlocked.CompareExchange<Object>(ref s_FormatterServicesSyncObject, o, null);
- }
- return s_FormatterServicesSyncObject;
- }
- }
-
- static FormatterServices()
- {
- // Static initialization touches security critical types, so we need an
- // explicit static constructor to allow us to mark it safe critical.
- }
-
- private static MemberInfo[] GetSerializableMembers(RuntimeType type) {
- // get the list of all fields
- FieldInfo[] fields = type.GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
- int countProper = 0;
- for (int i = 0; i < fields.Length; i++) {
- if ((fields[i].Attributes & FieldAttributes.NotSerialized) == FieldAttributes.NotSerialized)
- continue;
- countProper++;
- }
- if (countProper != fields.Length) {
- FieldInfo[] properFields = new FieldInfo[countProper];
- countProper = 0;
- for (int i = 0; i < fields.Length; i++) {
- if ((fields[i].Attributes & FieldAttributes.NotSerialized) == FieldAttributes.NotSerialized)
- continue;
- properFields[countProper] = fields[i];
- countProper++;
- }
- return properFields;
- }
- else
- return fields;
- }
-
- private static bool CheckSerializable(RuntimeType type) {
- if (type.IsSerializable) {
- return true;
- }
- return false;
- }
-
- private static MemberInfo[] InternalGetSerializableMembers(RuntimeType type) {
- List<SerializationFieldInfo> allMembers = null;
- MemberInfo[] typeMembers;
- FieldInfo [] typeFields;
- RuntimeType parentType;
-
- Debug.Assert((object)type != null, "[GetAllSerializableMembers]type!=null");
-
- if (type.IsInterface) {
- return new MemberInfo[0];
- }
-
- if (!(CheckSerializable(type))) {
- throw new SerializationException(Environment.GetResourceString("Serialization_NonSerType", type.FullName, type.Module.Assembly.FullName));
- }
-
- //Get all of the serializable members in the class to be serialized.
- typeMembers = GetSerializableMembers(type);
-
- //If this class doesn't extend directly from object, walk its hierarchy and
- //get all of the private and assembly-access fields (e.g. all fields that aren't
- //virtual) and include them in the list of things to be serialized.
- parentType = (RuntimeType)(type.BaseType);
- if (parentType != null && parentType != (RuntimeType)typeof(Object)) {
- RuntimeType[] parentTypes = null;
- int parentTypeCount = 0;
- bool classNamesUnique = GetParentTypes(parentType, out parentTypes, out parentTypeCount);
- if (parentTypeCount > 0){
- allMembers = new List<SerializationFieldInfo>();
- for (int i = 0; i < parentTypeCount;i++){
- parentType = parentTypes[i];
- if (!CheckSerializable(parentType)) {
- throw new SerializationException(Environment.GetResourceString("Serialization_NonSerType", parentType.FullName, parentType.Module.Assembly.FullName));
- }
-
- typeFields = parentType.GetFields(BindingFlags.NonPublic | BindingFlags.Instance);
- String typeName = classNamesUnique ? parentType.Name : parentType.FullName;
- foreach (FieldInfo field in typeFields) {
- // Family and Assembly fields will be gathered by the type itself.
- if (!field.IsNotSerialized) {
- allMembers.Add(new SerializationFieldInfo((RuntimeFieldInfo)field, typeName));
- }
- }
- }
- //If we actually found any new MemberInfo's, we need to create a new MemberInfo array and
- //copy all of the members which we've found so far into that.
- if (allMembers!=null && allMembers.Count>0) {
- MemberInfo[] membersTemp = new MemberInfo[allMembers.Count + typeMembers.Length];
- Array.Copy(typeMembers, membersTemp, typeMembers.Length);
- ((ICollection)allMembers).CopyTo(membersTemp, typeMembers.Length);
- typeMembers = membersTemp;
- }
- }
- }
- return typeMembers;
- }
-
- private static bool GetParentTypes(RuntimeType parentType, out RuntimeType[] parentTypes, out int parentTypeCount){
- //Check if there are any dup class names. Then we need to include as part of
- //typeName to prefix the Field names in SerializationFieldInfo
- /*out*/ parentTypes = null;
- /*out*/ parentTypeCount = 0;
- bool unique = true;
- RuntimeType objectType = (RuntimeType)typeof(object);
- for (RuntimeType t1 = parentType; t1 != objectType; t1 = (RuntimeType)t1.BaseType)
- {
- if (t1.IsInterface) continue;
- string t1Name = t1.Name;
- for(int i=0;unique && i<parentTypeCount;i++){
- string t2Name = parentTypes[i].Name;
- if (t2Name.Length == t1Name.Length && t2Name[0] == t1Name[0] && t1Name == t2Name){
- unique = false;
- break;
- }
- }
- //expand array if needed
- if (parentTypes == null || parentTypeCount == parentTypes.Length){
- RuntimeType[] tempParentTypes = new RuntimeType[Math.Max(parentTypeCount*2, 12)];
- if (parentTypes != null)
- Array.Copy(parentTypes, 0, tempParentTypes, 0, parentTypeCount);
- parentTypes = tempParentTypes;
- }
- parentTypes[parentTypeCount++] = t1;
- }
- return unique;
- }
-
- // Get all of the Serializable members for a particular class. For all practical intents and
- // purposes, this is the non-transient, non-static members (fields and properties). In order to
- // be included, properties must have both a getter and a setter. N.B.: A class
- // which implements ISerializable or has a serialization surrogate may not use all of these members
- // (or may have additional members).
- public static MemberInfo[] GetSerializableMembers(Type type) {
- return GetSerializableMembers(type, new StreamingContext(StreamingContextStates.All));
- }
-
- // Get all of the Serializable Members for a particular class. If we're not cloning, this is all
- // non-transient, non-static fields. If we are cloning, include the transient fields as well since
- // we know that we're going to live inside of the same context.
- public static MemberInfo[] GetSerializableMembers(Type type, StreamingContext context) {
- MemberInfo[] members;
-
- if ((object)type==null) {
- throw new ArgumentNullException(nameof(type));
- }
- Contract.EndContractBlock();
-
- if (!(type is RuntimeType)) {
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidType", type.ToString()));
- }
-
- MemberHolder mh = new MemberHolder(type, context);
-
- //If we've already gathered the members for this type, just return them.
- if (m_MemberInfoTable.ContainsKey(mh)) {
- return m_MemberInfoTable[mh];
- }
-
- lock (formatterServicesSyncObject) {
- //If we've already gathered the members for this type, just return them.
- if (m_MemberInfoTable.ContainsKey(mh)) {
- return m_MemberInfoTable[mh];
- }
-
- members = InternalGetSerializableMembers((RuntimeType)type);
-
- m_MemberInfoTable[mh] = members;
- }
-
- return members;
- }
-
- static readonly Type[] advancedTypes = new Type[]{
- typeof(System.DelegateSerializationHolder),
- };
-
- public static void CheckTypeSecurity(Type t, TypeFilterLevel securityLevel) {
- if (securityLevel == TypeFilterLevel.Low){
- for(int i=0;i<advancedTypes.Length;i++){
- if (advancedTypes[i].IsAssignableFrom(t))
- throw new SecurityException(Environment.GetResourceString("Serialization_TypeSecurity", advancedTypes[i].FullName, t.FullName));
- }
- }
- }
-#endif // FEATURE_SERIALIZATION
// Gets a new instance of the object. The entire object is initalized to 0 and no
// constructors have been run. **THIS MEANS THAT THE OBJECT MAY NOT BE IN A STATE
@@ -258,188 +50,9 @@ namespace System.Runtime.Serialization {
return nativeGetUninitializedObject((RuntimeType)type);
}
- public static Object GetSafeUninitializedObject(Type type) {
- if ((object)type == null) {
- throw new ArgumentNullException(nameof(type));
- }
- Contract.EndContractBlock();
-
- if (!(type is RuntimeType)) {
- throw new SerializationException(Environment.GetResourceString("Serialization_InvalidType", type.ToString()));
- }
-
- try {
- return nativeGetSafeUninitializedObject((RuntimeType)type);
- }
- catch(SecurityException e) {
- throw new SerializationException(Environment.GetResourceString("Serialization_Security", type.FullName), e);
- }
- }
-
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern Object nativeGetSafeUninitializedObject(RuntimeType type);
-
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private static extern Object nativeGetUninitializedObject(RuntimeType type);
-#if FEATURE_SERIALIZATION
- [MethodImplAttribute(MethodImplOptions.InternalCall)]
- private static extern bool GetEnableUnsafeTypeForwarders();
-
- internal static bool UnsafeTypeForwardersIsEnabled()
- {
- if (!unsafeTypeForwardersIsEnabledInitialized)
- {
- unsafeTypeForwardersIsEnabled = GetEnableUnsafeTypeForwarders();
- unsafeTypeForwardersIsEnabledInitialized = true;
- }
-
- return unsafeTypeForwardersIsEnabled;
- }
-#endif
private static Binder s_binder = Type.DefaultBinder;
- internal static void SerializationSetValue(MemberInfo fi, Object target, Object value)
- {
- Contract.Requires(fi != null);
-
- RtFieldInfo rtField = fi as RtFieldInfo;
-
- if (rtField != null)
- {
- rtField.CheckConsistency(target);
- rtField.UnsafeSetValue(target, value, BindingFlags.Default, s_binder, null);
- return;
- }
-
- SerializationFieldInfo serField = fi as SerializationFieldInfo;
- if (serField != null)
- {
- serField.InternalSetValue(target, value, BindingFlags.Default, s_binder, null);
- return;
- }
-
- throw new ArgumentException(Environment.GetResourceString("Argument_InvalidFieldInfo"));
- }
-
- // Fill in the members of obj with the data contained in data.
- // Returns the number of members populated.
- //
- public static Object PopulateObjectMembers(Object obj, MemberInfo[] members, Object[] data) {
- if (obj==null) {
- throw new ArgumentNullException(nameof(obj));
- }
-
- if (members==null) {
- throw new ArgumentNullException(nameof(members));
- }
-
- if (data==null) {
- throw new ArgumentNullException(nameof(data));
- }
-
- if (members.Length!=data.Length) {
- throw new ArgumentException(Environment.GetResourceString("Argument_DataLengthDifferent"));
- }
- Contract.EndContractBlock();
-
- MemberInfo mi;
-
- BCLDebug.Trace("SER", "[PopulateObjectMembers]Enter.");
-
- for (int i=0; i<members.Length; i++) {
- mi = members[i];
-
- if (mi==null) {
- throw new ArgumentNullException(nameof(members), Environment.GetResourceString("ArgumentNull_NullMember", i));
- }
-
- //If we find an empty, it means that the value was never set during deserialization.
- //This is either a forward reference or a null. In either case, this may break some of the
- //invariants mantained by the setter, so we'll do nothing with it for right now.
- if (data[i]!=null) {
- if (mi.MemberType==MemberTypes.Field) {
- SerializationSetValue(mi, obj, data[i]);
- } else {
- throw new SerializationException(Environment.GetResourceString("Serialization_UnknownMemberInfo"));
- }
-
- BCLDebug.Trace("SER", "[PopulateObjectMembers]\tType:", obj.GetType(), "\tMember:",
- members[i].Name, " with member type: ", ((FieldInfo)members[i]).FieldType);
- }
- //Console.WriteLine("X");
- }
-
- BCLDebug.Trace("SER", "[PopulateObjectMembers]Leave.");
-
- return obj;
- }
-
- // Extracts the data from obj. members is the array of members which we wish to
- // extract (must be FieldInfos or PropertyInfos). For each supplied member, extract the matching value and
- // return it in a Object[] of the same size.
- //
- public static Object[] GetObjectData(Object obj, MemberInfo[] members) {
-
- if (obj==null) {
- throw new ArgumentNullException(nameof(obj));
- }
-
- if (members==null) {
- throw new ArgumentNullException(nameof(members));
- }
- Contract.EndContractBlock();
-
- int numberOfMembers = members.Length;
-
- Object[] data = new Object[numberOfMembers];
- MemberInfo mi;
-
- for (int i=0; i<numberOfMembers; i++) {
- mi=members[i];
-
- if (mi==null) {
- throw new ArgumentNullException(nameof(members), Environment.GetResourceString("ArgumentNull_NullMember", i));
- }
-
- if (mi.MemberType==MemberTypes.Field) {
- Debug.Assert(mi is RuntimeFieldInfo || mi is SerializationFieldInfo,
- "[FormatterServices.GetObjectData]mi is RuntimeFieldInfo || mi is SerializationFieldInfo.");
-
- RtFieldInfo rfi = mi as RtFieldInfo;
- if (rfi != null) {
- rfi.CheckConsistency(obj);
- data[i] = rfi.UnsafeGetValue(obj);
- } else {
- data[i] = ((SerializationFieldInfo)mi).InternalGetValue(obj);
- }
- } else {
- throw new SerializationException(Environment.GetResourceString("Serialization_UnknownMemberInfo"));
- }
- }
-
- return data;
- }
-
- [System.Runtime.InteropServices.ComVisible(false)]
- public static ISerializationSurrogate GetSurrogateForCyclicalReference(ISerializationSurrogate innerSurrogate)
- {
- if (innerSurrogate == null)
- throw new ArgumentNullException(nameof(innerSurrogate));
- Contract.EndContractBlock();
- return new SurrogateForCyclicalReference(innerSurrogate);
- }
-
- /*=============================GetTypeFromAssembly==============================
- **Action:
- **Returns:
- **Arguments:
- **Exceptions:
- ==============================================================================*/
- public static Type GetTypeFromAssembly(Assembly assem, String name) {
- if (assem==null)
- throw new ArgumentNullException(nameof(assem));
- Contract.EndContractBlock();
- return assem.GetType(name, false, false);
- }
/*============================LoadAssemblyFromString============================
**Action: Loads an assembly from a given string. The current assembly loading story
@@ -460,99 +73,6 @@ namespace System.Runtime.Serialization {
Assembly found = Assembly.Load(assemblyName);
return found;
}
-
- internal static Assembly LoadAssemblyFromStringNoThrow(String assemblyName) {
- try {
- return LoadAssemblyFromString(assemblyName);
- }
- catch (Exception e){
- BCLDebug.Trace("SER", "[LoadAssemblyFromString]", e.ToString());
- }
- return null;
- }
-
- internal static string GetClrAssemblyName(Type type, out bool hasTypeForwardedFrom) {
- if ((object)type == null) {
- throw new ArgumentNullException(nameof(type));
- }
-
- object[] typeAttributes = type.GetCustomAttributes(typeof(TypeForwardedFromAttribute), false);
- if (typeAttributes != null && typeAttributes.Length > 0) {
- hasTypeForwardedFrom = true;
- TypeForwardedFromAttribute typeForwardedFromAttribute = (TypeForwardedFromAttribute)typeAttributes[0];
- return typeForwardedFromAttribute.AssemblyFullName;
- }
- else {
- hasTypeForwardedFrom = false;
- return type.Assembly.FullName;
- }
- }
-
- internal static string GetClrTypeFullName(Type type) {
- if (type.IsArray) {
- return GetClrTypeFullNameForArray(type);
- }
- else {
- return GetClrTypeFullNameForNonArrayTypes(type);
- }
- }
-
- static string GetClrTypeFullNameForArray(Type type) {
- int rank = type.GetArrayRank();
- if (rank == 1)
- {
- return String.Format(CultureInfo.InvariantCulture, "{0}{1}", GetClrTypeFullName(type.GetElementType()), "[]");
- }
- else
- {
- StringBuilder builder = new StringBuilder(GetClrTypeFullName(type.GetElementType())).Append("[");
- for (int commaIndex = 1; commaIndex < rank; commaIndex++)
- {
- builder.Append(",");
- }
- builder.Append("]");
- return builder.ToString();
- }
- }
-
- static string GetClrTypeFullNameForNonArrayTypes(Type type) {
- if (!type.IsGenericType) {
- return type.FullName;
- }
-
- Type[] genericArguments = type.GetGenericArguments();
- StringBuilder builder = new StringBuilder(type.GetGenericTypeDefinition().FullName).Append("[");
- bool hasTypeForwardedFrom;
-
- foreach (Type genericArgument in genericArguments) {
- builder.Append("[").Append(GetClrTypeFullName(genericArgument)).Append(", ");
- builder.Append(GetClrAssemblyName(genericArgument, out hasTypeForwardedFrom)).Append("],");
- }
-
- //remove the last comma and close typename for generic with a close bracket
- return builder.Remove(builder.Length - 1, 1).Append("]").ToString();
- }
- }
-
- internal sealed class SurrogateForCyclicalReference : ISerializationSurrogate
- {
- ISerializationSurrogate innerSurrogate;
- internal SurrogateForCyclicalReference(ISerializationSurrogate innerSurrogate)
- {
- if (innerSurrogate == null)
- throw new ArgumentNullException(nameof(innerSurrogate));
- this.innerSurrogate = innerSurrogate;
- }
-
- public void GetObjectData(Object obj, SerializationInfo info, StreamingContext context)
- {
- innerSurrogate.GetObjectData(obj, info, context);
- }
-
- public Object SetObjectData(Object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector)
- {
- return innerSurrogate.SetObjectData(obj, info, context, selector);
- }
}
}
diff --git a/src/mscorlib/src/System/Runtime/Serialization/IDeserializationCallback.cs b/src/mscorlib/src/System/Runtime/Serialization/IDeserializationCallback.cs
index e2497e5..2911a40 100644
--- a/src/mscorlib/src/System/Runtime/Serialization/IDeserializationCallback.cs
+++ b/src/mscorlib/src/System/Runtime/Serialization/IDeserializationCallback.cs
@@ -16,7 +16,6 @@ namespace System.Runtime.Serialization {
using System;
// Interface does not need to be marked with the serializable attribute
- [System.Runtime.InteropServices.ComVisible(true)]
public interface IDeserializationCallback {
void OnDeserialization(Object sender);
}
diff --git a/src/mscorlib/src/System/Runtime/Serialization/IFormatter.cs b/src/mscorlib/src/System/Runtime/Serialization/IFormatter.cs
deleted file mode 100644
index 8d91d95..0000000
--- a/src/mscorlib/src/System/Runtime/Serialization/IFormatter.cs
+++ /dev/null
@@ -1,41 +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.
-
-/*============================================================
-**
-** Interface: IFormatter;
-**
-**
-** Purpose: The interface for all formatters.
-**
-**
-===========================================================*/
-namespace System.Runtime.Serialization {
- using System.Runtime.Remoting;
- using System;
- using System.IO;
-
-[System.Runtime.InteropServices.ComVisible(true)]
- public interface IFormatter {
- Object Deserialize(Stream serializationStream);
-
- void Serialize(Stream serializationStream, Object graph);
-
-
- ISurrogateSelector SurrogateSelector {
- get;
- set;
- }
-
- SerializationBinder Binder {
- get;
- set;
- }
-
- StreamingContext Context {
- get;
- set;
- }
- }
-}
diff --git a/src/mscorlib/src/System/Runtime/Serialization/IFormatterConverter.cs b/src/mscorlib/src/System/Runtime/Serialization/IFormatterConverter.cs
index 182cc93..0be0db9 100644
--- a/src/mscorlib/src/System/Runtime/Serialization/IFormatterConverter.cs
+++ b/src/mscorlib/src/System/Runtime/Serialization/IFormatterConverter.cs
@@ -17,7 +17,6 @@ namespace System.Runtime.Serialization {
using System;
[CLSCompliant(false)]
-[System.Runtime.InteropServices.ComVisible(true)]
public interface IFormatterConverter {
Object Convert(Object value, Type type);
Object Convert(Object value, TypeCode typeCode);
diff --git a/src/mscorlib/src/System/Runtime/Serialization/IObjectReference.cs b/src/mscorlib/src/System/Runtime/Serialization/IObjectReference.cs
index 42662a1..ef5ee6a 100644
--- a/src/mscorlib/src/System/Runtime/Serialization/IObjectReference.cs
+++ b/src/mscorlib/src/System/Runtime/Serialization/IObjectReference.cs
@@ -18,9 +18,7 @@
namespace System.Runtime.Serialization {
using System;
- using System.Security.Permissions;
// Interface does not need to be marked with the serializable attribute
-[System.Runtime.InteropServices.ComVisible(true)]
public interface IObjectReference {
Object GetRealObject(StreamingContext context);
}
diff --git a/src/mscorlib/src/System/Runtime/Serialization/ISerializable.cs b/src/mscorlib/src/System/Runtime/Serialization/ISerializable.cs
index fc283d4..816aa04 100644
--- a/src/mscorlib/src/System/Runtime/Serialization/ISerializable.cs
+++ b/src/mscorlib/src/System/Runtime/Serialization/ISerializable.cs
@@ -16,11 +16,9 @@
namespace System.Runtime.Serialization {
using System.Runtime.Remoting;
using System.Runtime.Serialization;
- using System.Security.Permissions;
using System;
using System.Reflection;
- [System.Runtime.InteropServices.ComVisible(true)]
public interface ISerializable {
void GetObjectData(SerializationInfo info, StreamingContext context);
}
diff --git a/src/mscorlib/src/System/Runtime/Serialization/ISerializationSurrogate.cs b/src/mscorlib/src/System/Runtime/Serialization/ISerializationSurrogate.cs
deleted file mode 100644
index 226bbdc..0000000
--- a/src/mscorlib/src/System/Runtime/Serialization/ISerializationSurrogate.cs
+++ /dev/null
@@ -1,34 +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.
-
-/*============================================================
-**
-** Interface: ISurrogate
-**
-**
-** Purpose: The interface implemented by an object which
-** supports surrogates.
-**
-**
-===========================================================*/
-namespace System.Runtime.Serialization {
- using System.Runtime.Remoting;
- using System.Runtime.Serialization;
- using System.Security.Permissions;
- using System;
- using System.Reflection;
-[System.Runtime.InteropServices.ComVisible(true)]
- public interface ISerializationSurrogate {
- // Interface does not need to be marked with the serializable attribute
- // Returns a SerializationInfo completely populated with all of the data needed to reinstantiate the
- // the object at the other end of serialization.
- //
- void GetObjectData(Object obj, SerializationInfo info, StreamingContext context);
-
- // Reinflate the object using all of the information in data. The information in
- // members is used to find the particular field or property which needs to be set.
- //
- Object SetObjectData(Object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector);
- }
-}
diff --git a/src/mscorlib/src/System/Runtime/Serialization/ISurrogateSelector.cs b/src/mscorlib/src/System/Runtime/Serialization/ISurrogateSelector.cs
deleted file mode 100644
index 87b7845..0000000
--- a/src/mscorlib/src/System/Runtime/Serialization/ISurrogateSelector.cs
+++ /dev/null
@@ -1,34 +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.
-
-/*============================================================
-**
-** Interface: ISurrogateSelector
-**
-**
-** Purpose: A user-supplied class for doing the type to surrogate
-** mapping.
-**
-**
-===========================================================*/
-namespace System.Runtime.Serialization {
-
- using System.Runtime.Remoting;
- using System.Security.Permissions;
- using System;
-[System.Runtime.InteropServices.ComVisible(true)]
- public interface ISurrogateSelector {
- // Interface does not need to be marked with the serializable attribute
- // Specifies the next ISurrogateSelector to be examined for surrogates if the current
- // instance doesn't have a surrogate for the given type and assembly in the given context.
- void ChainSelector(ISurrogateSelector selector);
-
- // Returns the appropriate surrogate for the given type in the given context.
- ISerializationSurrogate GetSurrogate(Type type, StreamingContext context, out ISurrogateSelector selector);
-
-
- // Return the next surrogate in the chain. Returns null if no more exist.
- ISurrogateSelector GetNextSelector();
- }
-}
diff --git a/src/mscorlib/src/System/Runtime/Serialization/MemberHolder.cs b/src/mscorlib/src/System/Runtime/Serialization/MemberHolder.cs
deleted file mode 100644
index 1303e40..0000000
--- a/src/mscorlib/src/System/Runtime/Serialization/MemberHolder.cs
+++ /dev/null
@@ -1,51 +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.
-
-/*============================================================
-**
-**
-**
-** Purpose: This is a lightweight class designed to hold the members
-** and StreamingContext for a particular class.
-**
-**
-============================================================*/
-namespace System.Runtime.Serialization {
-
- using System.Runtime.Remoting;
- using System;
- using System.Reflection;
- [Serializable]
- internal class MemberHolder {
-// disable csharp compiler warning #0414: field assigned unused value
-#pragma warning disable 0414
- internal MemberInfo[] members = null;
-#pragma warning restore 0414
- internal Type memberType;
- internal StreamingContext context;
-
- internal MemberHolder(Type type, StreamingContext ctx) {
- memberType = type;
- context = ctx;
- }
-
- public override int GetHashCode() {
- return memberType.GetHashCode();
- }
-
- public override bool Equals(Object obj) {
- if (!(obj is MemberHolder)) {
- return false;
- }
-
- MemberHolder temp = (MemberHolder)obj;
-
- if (Object.ReferenceEquals(temp.memberType, memberType) && temp.context.State == context.State) {
- return true;
- }
-
- return false;
- }
- }
-}
diff --git a/src/mscorlib/src/System/Runtime/Serialization/SafeSerializationManager.cs b/src/mscorlib/src/System/Runtime/Serialization/SafeSerializationManager.cs
index 585d367..260e873 100644
--- a/src/mscorlib/src/System/Runtime/Serialization/SafeSerializationManager.cs
+++ b/src/mscorlib/src/System/Runtime/Serialization/SafeSerializationManager.cs
@@ -1,4 +1,4 @@
-// Licensed to the .NET Foundation under one or more agreements.
+// 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.
using System;
@@ -211,10 +211,7 @@ namespace System.Runtime.Serialization
private StreamingContext m_streamingContext;
private List<object> m_serializedStates = new List<object>();
- internal SafeSerializationEventArgs(StreamingContext streamingContext)
- {
- m_streamingContext = streamingContext;
- }
+ internal SafeSerializationEventArgs() {}
public void AddSerializedState(ISafeSerializationData serializedState)
{
@@ -226,11 +223,6 @@ namespace System.Runtime.Serialization
m_serializedStates.Add(serializedState);
}
- internal IList<object> SerializedStates
- {
- get { return m_serializedStates; }
- }
-
public StreamingContext StreamingContext
{
get { return m_streamingContext; }
@@ -245,202 +237,4 @@ namespace System.Runtime.Serialization
// this object.
void CompleteDeserialization(object deserialized);
}
-#if FEATURE_SERIALIZATION
- // Helper class to implement safe serialization. Concrete ISerializable types which want to allow
- // transparent subclasses code to participate in serialization should contain an instance of
- // SafeSerializationManager and wire up to it as described in code:#SafeSerialization.
- [Serializable]
- internal sealed class SafeSerializationManager : IObjectReference, ISerializable
- {
- // Saved states to store in the serialization stream. This is typed as object rather than
- // ISafeSerializationData because ISafeSerializationData can't be marked serializable.
- private IList<object> m_serializedStates;
-
- // This is the SerializationInfo that is used when the SafeSerializationManager type has replaced
- // itself as the target of serialziation. It is not used directly by the safe serialization code,
- // but just held onto so that the real object being deserialzed can use it later.
- private SerializationInfo m_savedSerializationInfo;
-
- // Real object that we've deserialized - this is stored when we complete construction and calling
- // the deserialization .ctors on it and is used when we need to notify the stored safe
- // deserialization data that they should populate the object with their fields.
- private object m_realObject;
-
- // Real type that should be deserialized
- private RuntimeType m_realType;
-
- // Event fired when we need to collect state to serialize into the parent object
- internal event EventHandler<SafeSerializationEventArgs> SerializeObjectState;
-
- // Name that is used to store the real type being deserialized in the main SerializationInfo
- private const string RealTypeSerializationName = "CLR_SafeSerializationManager_RealType";
-
- internal SafeSerializationManager()
- {
- }
-
- private SafeSerializationManager(SerializationInfo info, StreamingContext context)
- {
- // We need to determine if we're being called to really deserialize a SafeSerializationManager,
- // or if we're being called because we've intercepted the deserialization callback for the real
- // object being deserialized. We use the presence of the RealTypeSerializationName field in the
- // serialization info to indicate that this is the interception callback and we just need to
- // safe the info. If that field is not present, then we should be in a real deserialization
- // construction.
- RuntimeType realType = info.GetValueNoThrow(RealTypeSerializationName, typeof(RuntimeType)) as RuntimeType;
-
- if (realType == null)
- {
- m_serializedStates = info.GetValue("m_serializedStates", typeof(List<object>)) as List<object>;
- }
- else
- {
- m_realType = realType;
- m_savedSerializationInfo = info;
- }
- }
-
- // Determine if the serialization manager is in an active state - that is if any code is hooked up
- // to use it for serialization
- internal bool IsActive
- {
- get { return SerializeObjectState != null; }
- }
-
- // CompleteSerialization is called by the base ISerializable in its GetObjectData method. It is
- // responsible for gathering up the serialized object state of any delegates that wish to add their
- // own state to the serialized object.
- internal void CompleteSerialization(object serializedObject,
- SerializationInfo info,
- StreamingContext context)
- {
- Contract.Requires(serializedObject != null);
- Contract.Requires(info != null);
- Contract.Requires(typeof(ISerializable).IsAssignableFrom(serializedObject.GetType()));
- Contract.Requires(serializedObject.GetType().IsAssignableFrom(info.ObjectType));
-
- // Clear out any stale state
- m_serializedStates = null;
-
- // We only want to kick in our special serialization sauce if someone wants to participate in
- // it, otherwise if we have no delegates registered there's no reason for us to get in the way
- // of the regular serialization machinery.
- EventHandler<SafeSerializationEventArgs> serializeObjectStateEvent = SerializeObjectState;
- if (serializeObjectStateEvent != null)
- {
- // Get any extra data to add to our serialization state now
- SafeSerializationEventArgs eventArgs = new SafeSerializationEventArgs(context);
- serializeObjectStateEvent(serializedObject, eventArgs);
- m_serializedStates = eventArgs.SerializedStates;
-
- // Replace the type to be deserialized by the standard serialization code paths with
- // ourselves, which allows us to control the deserialization process.
- info.AddValue(RealTypeSerializationName, serializedObject.GetType(), typeof(RuntimeType));
- info.SetType(typeof(SafeSerializationManager));
- }
- }
-
- // CompleteDeserialization is called by the base ISerializable object's OnDeserialized handler to
- // finish the deserialization of the object by notifying the saved states that they should
- // re-populate their portions of the deserialized object.
- internal void CompleteDeserialization(object deserializedObject)
- {
- Contract.Requires(deserializedObject != null);
-
- if (m_serializedStates != null)
- {
- foreach (ISafeSerializationData serializedState in m_serializedStates)
- {
- serializedState.CompleteDeserialization(deserializedObject);
- }
- }
- }
-
- void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
- {
- info.AddValue("m_serializedStates", m_serializedStates, typeof(List<IDeserializationCallback>));
- }
-
- // GetRealObject intercepts the deserialization process in order to allow deserializing part of the
- // object's inheritance heirarchy using standard ISerializable constructors, and the remaining
- // portion using the saved serialization states.
- object IObjectReference.GetRealObject(StreamingContext context)
- {
- // If we've already deserialized the real object, use that rather than deserializing it again
- if (m_realObject != null)
- {
- return m_realObject;
- }
-
- // If we don't have a real type to deserialize, then this is really a SafeSerializationManager
- // and we don't need to rebuild the object that we're standing in for.
- if (m_realType == null)
- {
- return this;
- }
-
- // Look for the last type in GetRealType's inheritance hierarchy which implements a critical
- // deserialization constructor. This will be the object that we use as the deserialization
- // construction type to initialize via standard ISerializable semantics
-
- // First build up the chain starting at the type below Object and working to the real type we
- // serialized.
- Stack inheritanceChain = new Stack();
- RuntimeType currentType = m_realType;
- do
- {
- inheritanceChain.Push(currentType);
- currentType = currentType.BaseType as RuntimeType;
- }
- while (currentType != typeof(object));
-
- // Now look for the first type that does not implement the ISerializable .ctor. When we find
- // that, previousType will point at the last type that did implement the .ctor. We require that
- // the .ctor we invoke also be non-transparent
- RuntimeConstructorInfo serializationCtor = null;
- RuntimeType previousType = null;
- do
- {
- previousType = currentType;
- currentType = inheritanceChain.Pop() as RuntimeType;
- serializationCtor = currentType.GetSerializationCtor();
- }
- while (serializationCtor != null && serializationCtor.IsSecurityCritical);
-
- // previousType is the last type that did implement the deserialization .ctor before the first
- // type that did not, so we'll grab it's .ctor to use for deserialization.
- BCLDebug.Assert(previousType != null, "We should have at least one inheritance from the base type");
- serializationCtor = ObjectManager.GetConstructor(previousType);
-
- // Allocate an instance of the final type and run the selected .ctor on that instance to get the
- // standard ISerializable initialization done.
- object deserialized = FormatterServices.GetUninitializedObject(m_realType);
- serializationCtor.SerializationInvoke(deserialized, m_savedSerializationInfo, context);
- m_savedSerializationInfo = null;
- m_realType = null;
-
- // Save away the real object that was deserialized so that we can fill it in later, and return
- // it back as the object that should result from the final deserialization.
- m_realObject = deserialized;
- return deserialized;
- }
-
- [OnDeserialized]
- private void OnDeserialized(StreamingContext context)
- {
- // We only need to complete deserialization if we were hooking the deserialization process. If
- // we have not deserialized an object in the GetRealObject call, then there's nothing more for
- // us to do here.
- if (m_realObject != null)
- {
- // Fire the real object's OnDeserialized method if they registered one. Since we replaced
- // ourselves as the target of the deserialization, OnDeserialized on the target won't
- // automatically get triggered unless we do it manually.
- SerializationEvents cache = SerializationEventsCache.GetSerializationEventsForType(m_realObject.GetType());
- cache.InvokeOnDeserialized(m_realObject, context);
- m_realObject = null;
- }
- }
- }
-#endif
}
diff --git a/src/mscorlib/src/System/Runtime/Serialization/SerializationAttributes.cs b/src/mscorlib/src/System/Runtime/Serialization/SerializationAttributes.cs
index 27c5751..38abffa 100644
--- a/src/mscorlib/src/System/Runtime/Serialization/SerializationAttributes.cs
+++ b/src/mscorlib/src/System/Runtime/Serialization/SerializationAttributes.cs
@@ -17,7 +17,6 @@ namespace System.Runtime.Serialization
using System.Reflection;
[AttributeUsage(AttributeTargets.Field, Inherited=false)]
-[System.Runtime.InteropServices.ComVisible(true)]
public sealed class OptionalFieldAttribute : Attribute
{
int versionAdded = 1;
@@ -38,25 +37,21 @@ namespace System.Runtime.Serialization
}
[AttributeUsage(AttributeTargets.Method, Inherited=false)]
-[System.Runtime.InteropServices.ComVisible(true)]
public sealed class OnSerializingAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Method, Inherited=false)]
-[System.Runtime.InteropServices.ComVisible(true)]
public sealed class OnSerializedAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Method, Inherited=false)]
-[System.Runtime.InteropServices.ComVisible(true)]
public sealed class OnDeserializingAttribute : Attribute
{
}
[AttributeUsage(AttributeTargets.Method, Inherited=false)]
-[System.Runtime.InteropServices.ComVisible(true)]
public sealed class OnDeserializedAttribute : Attribute
{
}
diff --git a/src/mscorlib/src/System/Runtime/Serialization/SerializationBinder.cs b/src/mscorlib/src/System/Runtime/Serialization/SerializationBinder.cs
deleted file mode 100644
index 7457991..0000000
--- a/src/mscorlib/src/System/Runtime/Serialization/SerializationBinder.cs
+++ /dev/null
@@ -1,29 +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.
-
-/*============================================================
-**
-** Interface: SerializationBinder
-**
-**
-** Purpose: The base class of serialization binders.
-**
-**
-===========================================================*/
-namespace System.Runtime.Serialization {
- using System;
-
- [Serializable]
-[System.Runtime.InteropServices.ComVisible(true)]
- public abstract class SerializationBinder {
-
- public virtual void BindToName(Type serializedType, out String assemblyName, out String typeName)
- {
- assemblyName = null;
- typeName = null;
- }
-
- public abstract Type BindToType(String assemblyName, String typeName);
- }
-}
diff --git a/src/mscorlib/src/System/Runtime/Serialization/SerializationException.cs b/src/mscorlib/src/System/Runtime/Serialization/SerializationException.cs
index b88ccfd..e9cb79b 100644
--- a/src/mscorlib/src/System/Runtime/Serialization/SerializationException.cs
+++ b/src/mscorlib/src/System/Runtime/Serialization/SerializationException.cs
@@ -17,7 +17,6 @@ namespace System.Runtime.Serialization {
using System;
using System.Runtime.Serialization;
- [System.Runtime.InteropServices.ComVisible(true)]
[Serializable]
public class SerializationException : SystemException {
diff --git a/src/mscorlib/src/System/Runtime/Serialization/SerializationFieldInfo.cs b/src/mscorlib/src/System/Runtime/Serialization/SerializationFieldInfo.cs
deleted file mode 100644
index 82536ce..0000000
--- a/src/mscorlib/src/System/Runtime/Serialization/SerializationFieldInfo.cs
+++ /dev/null
@@ -1,136 +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.
-
-/*============================================================
-**
-**
-**
-** Purpose: Provides a methods of representing imaginary fields
-** which are unique to serialization. In this case, what we're
-** representing is the private members of parent classes. We
-** aggregate the RuntimeFieldInfo associated with this member
-** and return a managled form of the name. The name that we
-** return is .parentname.fieldname
-**
-**
-============================================================*/
-
-namespace System.Runtime.Serialization {
-
- using System;
- using System.Reflection;
- using System.Globalization;
- using System.Diagnostics;
- using System.Diagnostics.Contracts;
- using System.Threading;
-
- internal sealed class SerializationFieldInfo : FieldInfo {
-
- internal const String FakeNameSeparatorString = "+";
-
- private RuntimeFieldInfo m_field;
- private String m_serializationName;
-
- public override Module Module { get { return m_field.Module; } }
- public override int MetadataToken { get { return m_field.MetadataToken; } }
-
- internal SerializationFieldInfo(RuntimeFieldInfo field, String namePrefix) {
- Debug.Assert(field!=null, "[SerializationFieldInfo.ctor]field!=null");
- Debug.Assert(namePrefix!=null, "[SerializationFieldInfo.ctor]namePrefix!=null");
-
- m_field = field;
- m_serializationName = String.Concat(namePrefix, FakeNameSeparatorString, m_field.Name);
- }
-
- //
- // MemberInfo methods
- //
- public override String Name {
- get {
- return m_serializationName;
- }
- }
-
- public override Type DeclaringType {
- get {
- return m_field.DeclaringType;
- }
- }
-
- public override Type ReflectedType {
- get {
- return m_field.ReflectedType;
- }
- }
-
- public override Object[] GetCustomAttributes(bool inherit) {
- return m_field.GetCustomAttributes(inherit);
- }
-
- public override Object[] GetCustomAttributes(Type attributeType, bool inherit) {
- return m_field.GetCustomAttributes(attributeType, inherit);
- }
-
- public override bool IsDefined(Type attributeType, bool inherit) {
- return m_field.IsDefined(attributeType, inherit);
- }
-
- //
- // FieldInfo methods
- //
- public override Type FieldType {
- get {
- return m_field.FieldType;
- }
- }
-
- public override Object GetValue(Object obj) {
- return m_field.GetValue(obj);
- }
-
- internal Object InternalGetValue(Object obj) {
- RtFieldInfo field = m_field as RtFieldInfo;
- if (field != null)
- {
- field.CheckConsistency(obj);
- return field.UnsafeGetValue(obj);
- }
- else
- return m_field.GetValue(obj);
- }
-
- public override void SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, CultureInfo culture) {
- m_field.SetValue(obj, value, invokeAttr, binder, culture);
- }
-
- internal void InternalSetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, CultureInfo culture) {
- RtFieldInfo field = m_field as RtFieldInfo;
- if (field != null)
- {
- field.CheckConsistency(obj);
- field.UnsafeSetValue(obj, value, invokeAttr, binder, culture);
- }
- else
- m_field.SetValue(obj, value, invokeAttr, binder, culture);
- }
-
- internal RuntimeFieldInfo FieldInfo {
- get {
- return m_field;
- }
- }
-
- public override RuntimeFieldHandle FieldHandle {
- get {
- return m_field.FieldHandle;
- }
- }
-
- public override FieldAttributes Attributes {
- get {
- return m_field.Attributes;
- }
- }
- }
-}
diff --git a/src/mscorlib/src/System/Runtime/Serialization/SerializationInfo.cs b/src/mscorlib/src/System/Runtime/Serialization/SerializationInfo.cs
index 55909c8..45521f2 100644
--- a/src/mscorlib/src/System/Runtime/Serialization/SerializationInfo.cs
+++ b/src/mscorlib/src/System/Runtime/Serialization/SerializationInfo.cs
@@ -24,7 +24,6 @@ namespace System.Runtime.Serialization
using System.Security;
using System.Runtime.CompilerServices;
- [System.Runtime.InteropServices.ComVisible(true)]
public sealed class SerializationInfo
{
private const int defaultSize = 4;
@@ -146,49 +145,10 @@ namespace System.Runtime.Serialization
}
}
- private static bool Compare(byte[] a, byte[] b)
- {
- // if either or both assemblies do not have public key token, we should demand, hence, returning false will force a demand
- if (a == null || b == null || a.Length == 0 || b.Length == 0 || a.Length != b.Length)
- {
- return false;
- }
- else
- {
- for (int i = 0; i < a.Length; i++)
- {
- if (a[i] != b[i]) return false;
- }
-
- return true;
- }
- }
-
internal static void DemandForUnsafeAssemblyNameAssignments(string originalAssemblyName, string newAssemblyName)
{
}
- internal static bool IsAssemblyNameAssignmentSafe(string originalAssemblyName, string newAssemblyName)
- {
- if (originalAssemblyName == newAssemblyName)
- {
- return true;
- }
-
- AssemblyName originalAssembly = new AssemblyName(originalAssemblyName);
- AssemblyName newAssembly = new AssemblyName(newAssemblyName);
-
- // mscorlib will get loaded by the runtime regardless of its string casing or its public key token,
- // so setting the assembly name to mscorlib must always be protected by a demand
- if (string.Equals(newAssembly.Name, s_mscorlibAssemblySimpleName, StringComparison.OrdinalIgnoreCase) ||
- string.Equals(newAssembly.Name, s_mscorlibFileName, StringComparison.OrdinalIgnoreCase))
- {
- return false;
- }
-
- return Compare(originalAssembly.GetPublicKeyToken(), newAssembly.GetPublicKeyToken());
- }
-
public int MemberCount
{
get
@@ -467,7 +427,6 @@ namespace System.Runtime.Serialization
return m_data[index];
}
- [System.Runtime.InteropServices.ComVisible(true)]
private Object GetElementNoThrow(String name, out Type foundType)
{
int index = FindElement(name);
@@ -518,7 +477,6 @@ namespace System.Runtime.Serialization
return m_converter.Convert(value, type);
}
- [System.Runtime.InteropServices.ComVisible(true)]
internal Object GetValueNoThrow(String name, Type type)
{
Type foundType;
@@ -741,22 +699,5 @@ namespace System.Runtime.Serialization
return m_converter.ToString(value);
}
- internal string[] MemberNames
- {
- get
- {
- return m_members;
- }
-
- }
-
- internal object[] MemberValues
- {
- get
- {
- return m_data;
- }
- }
-
}
}
diff --git a/src/mscorlib/src/System/Runtime/Serialization/SerializationInfoEnumerator.cs b/src/mscorlib/src/System/Runtime/Serialization/SerializationInfoEnumerator.cs
index 32c6549..0858dfc 100644
--- a/src/mscorlib/src/System/Runtime/Serialization/SerializationInfoEnumerator.cs
+++ b/src/mscorlib/src/System/Runtime/Serialization/SerializationInfoEnumerator.cs
@@ -21,7 +21,6 @@ namespace System.Runtime.Serialization {
//
// The tuple returned by SerializationInfoEnumerator.Current.
//
-[System.Runtime.InteropServices.ComVisible(true)]
public struct SerializationEntry {
private Type m_type;
private Object m_value;
@@ -57,7 +56,6 @@ namespace System.Runtime.Serialization {
// This does not snapshot the values, it just keeps pointers to the
// member variables of the SerializationInfo that created it.
//
-[System.Runtime.InteropServices.ComVisible(true)]
public sealed class SerializationInfoEnumerator : IEnumerator {
String[] m_members;
Object[] m_data;
diff --git a/src/mscorlib/src/System/Runtime/Serialization/StreamingContext.cs b/src/mscorlib/src/System/Runtime/Serialization/StreamingContext.cs
index ef4a096..c01a3ed 100644
--- a/src/mscorlib/src/System/Runtime/Serialization/StreamingContext.cs
+++ b/src/mscorlib/src/System/Runtime/Serialization/StreamingContext.cs
@@ -16,7 +16,6 @@ namespace System.Runtime.Serialization {
using System.Runtime.Remoting;
using System;
[Serializable]
-[System.Runtime.InteropServices.ComVisible(true)]
public struct StreamingContext {
internal Object m_additionalContext;
internal StreamingContextStates m_state;
@@ -59,7 +58,6 @@ namespace System.Runtime.Serialization {
// **********************************************************
[Serializable]
[Flags]
-[System.Runtime.InteropServices.ComVisible(true)]
public enum StreamingContextStates {
CrossProcess=0x01,
CrossMachine=0x02,