Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@@ -40,11 +40,7 @@ using System.Globalization;
namespace System.Runtime.Serialization
{
[System.Runtime.InteropServices.ComVisibleAttribute (true)]
#if NET_4_5
static
#else
sealed
#endif
public class FormatterServices
{
private const BindingFlags fieldFlags = BindingFlags.Public |
@@ -52,11 +48,6 @@ namespace System.Runtime.Serialization
BindingFlags.NonPublic |
BindingFlags.DeclaredOnly;
#if !NET_4_5
private FormatterServices ()
{
}
#endif
public static object [] GetObjectData (object obj, MemberInfo [] members)
{
@@ -215,7 +206,6 @@ namespace System.Runtime.Serialization
return GetUninitializedObject (type);
}
#if NET_4_0
// This method was introduced in .Net due to a bug serializing objects with circular references
// which we don't appear to have, so we just return the same object.
// See http://support.microsoft.com/kb/927495/en-us/ in case of doubt.
@@ -224,6 +214,5 @@ namespace System.Runtime.Serialization
{
return innerSurrogate;
}
#endif
}
}

View File

@@ -26,7 +26,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_4_0
namespace System.Runtime.Serialization {
@@ -35,4 +34,3 @@ namespace System.Runtime.Serialization {
}
}
#endif

View File

@@ -26,7 +26,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_4_0
namespace System.Runtime.Serialization {
@@ -49,4 +48,3 @@ namespace System.Runtime.Serialization {
}
}
#endif

View File

@@ -43,12 +43,10 @@ namespace System.Runtime.Serialization
public abstract Type BindToType (string assemblyName, string typeName);
#if NET_4_0
public virtual void BindToName (Type serializedType, out string assemblyName, out string typeName)
{
assemblyName = null;
typeName = null;
}
#endif
}
}

View File

@@ -46,11 +46,9 @@ namespace System.Runtime.Serialization
string assemblyName; // the assembly being serialized
string fullTypeName; // the type being serialized.
#if NET_4_0
Type objectType;
bool isAssemblyNameSetExplicit;
bool isFullTypeNameSetExplicit;
#endif
IFormatterConverter converter;
@@ -60,9 +58,7 @@ namespace System.Runtime.Serialization
assemblyName = type.Assembly.FullName;
fullTypeName = type.FullName;
converter = new FormatterConverter ();
#if NET_4_0
objectType = type;
#endif
}
/* used by the runtime */
@@ -73,9 +69,7 @@ namespace System.Runtime.Serialization
assemblyName = type.Assembly.FullName;
fullTypeName = type.FullName;
converter = new FormatterConverter ();
#if NET_4_0
objectType = type;
#endif
for (int i = 0; i < len; i++) {
serialized.Add (data [i].Name, data [i]);
@@ -96,9 +90,7 @@ namespace System.Runtime.Serialization
this.converter = converter;
assemblyName = type.Assembly.FullName;
fullTypeName = type.FullName;
#if NET_4_0
objectType = type;
#endif
}
// Properties
@@ -110,9 +102,7 @@ namespace System.Runtime.Serialization
if (value == null)
throw new ArgumentNullException ("Argument is null.");
assemblyName = value;
#if NET_4_0
isAssemblyNameSetExplicit = true;
#endif
}
}
@@ -124,9 +114,7 @@ namespace System.Runtime.Serialization
if ( value == null)
throw new ArgumentNullException ("Argument is null.");
fullTypeName = value;
#if NET_4_0
isFullTypeNameSetExplicit = true;
#endif
}
}
@@ -135,7 +123,6 @@ namespace System.Runtime.Serialization
get { return serialized.Count; }
}
#if NET_4_0
public bool IsAssemblyNameSetExplicit {
get {
return isAssemblyNameSetExplicit;
@@ -153,7 +140,6 @@ namespace System.Runtime.Serialization
return objectType;
}
}
#endif
// Methods
public void AddValue (string name, object value, Type type)
@@ -201,11 +187,9 @@ namespace System.Runtime.Serialization
fullTypeName = type.FullName;
assemblyName = type.Assembly.FullName;
#if NET_4_0
objectType = type;
isAssemblyNameSetExplicit = false;
isFullTypeNameSetExplicit = false;
#endif
}
public SerializationInfoEnumerator GetEnumerator ()