using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization.Formatters;
+using System.Globalization;
namespace System.Runtime.Serialization
{
+ [System.Runtime.InteropServices.ComVisibleAttribute (true)]
public sealed class FormatterServices
{
private const BindingFlags fieldFlags = BindingFlags.Public |
throw new SerializationException (msg);
}
- GetFields (t, fields);
+ GetFields (type, t, fields);
t = t.BaseType;
}
return result;
}
- private static void GetFields (Type type, ArrayList fields)
+ private static void GetFields (Type reflectedType, Type type, ArrayList fields)
{
FieldInfo [] fs = type.GetFields (fieldFlags);
foreach (FieldInfo field in fs)
- if (!(field.IsNotSerialized))
- fields.Add (field);
+ if (!(field.IsNotSerialized)) {
+ MonoField mf = field as MonoField;
+ if (mf != null && reflectedType != type && !mf.IsPublic) {
+ string fname = type.Name + "+" + mf.Name;
+ fields.Add (mf.Clone (fname));
+ }
+ else
+ fields.Add (field);
+ }
}
public static Type GetTypeFromAssembly (Assembly assem, string name)