Imported Upstream version 5.0.0.42

Former-commit-id: fd56571888259555122d8a0f58c68838229cea2b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-04-10 11:41:01 +00:00
parent 1190d13a04
commit 6bdd276d05
19939 changed files with 3099680 additions and 93811 deletions

View File

@@ -0,0 +1,51 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Runtime.Serialization.Formatters.Tests", "tests\System.Runtime.Serialization.Formatters.Tests.csproj", "{7C70BB15-870B-4946-8098-625DACD645A6}"
ProjectSection(ProjectDependencies) = postProject
{CA488507-3B6E-4494-B7BE-7B4EEEB2C4D1} = {CA488507-3B6E-4494-B7BE-7B4EEEB2C4D1}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Runtime.Serialization.Formatters", "src\System.Runtime.Serialization.Formatters.csproj", "{CA488507-3B6E-4494-B7BE-7B4EEEB2C4D1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU = DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU
ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU = ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU
DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU = DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU
ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU = ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU
DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU = DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU
ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU = ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7C70BB15-870B-4946-8098-625DACD645A6}.DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Debug|Any CPU
{7C70BB15-870B-4946-8098-625DACD645A6}.DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.Build.0 = netcoreapp-Debug|Any CPU
{7C70BB15-870B-4946-8098-625DACD645A6}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Release|Any CPU
{7C70BB15-870B-4946-8098-625DACD645A6}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.Build.0 = netcoreapp-Release|Any CPU
{7C70BB15-870B-4946-8098-625DACD645A6}.DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Debug|Any CPU
{7C70BB15-870B-4946-8098-625DACD645A6}.DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU.Build.0 = netcoreapp-Debug|Any CPU
{7C70BB15-870B-4946-8098-625DACD645A6}.ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Release|Any CPU
{7C70BB15-870B-4946-8098-625DACD645A6}.ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU.Build.0 = netcoreapp-Release|Any CPU
{7C70BB15-870B-4946-8098-625DACD645A6}.DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Debug|Any CPU
{7C70BB15-870B-4946-8098-625DACD645A6}.DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU.Build.0 = netcoreapp-Debug|Any CPU
{7C70BB15-870B-4946-8098-625DACD645A6}.ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Release|Any CPU
{7C70BB15-870B-4946-8098-625DACD645A6}.ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU.Build.0 = netcoreapp-Release|Any CPU
{CA488507-3B6E-4494-B7BE-7B4EEEB2C4D1}.DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = net463-Windows_NT-Debug|Any CPU
{CA488507-3B6E-4494-B7BE-7B4EEEB2C4D1}.DebugNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.Build.0 = net463-Windows_NT-Debug|Any CPU
{CA488507-3B6E-4494-B7BE-7B4EEEB2C4D1}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.ActiveCfg = net463-Windows_NT-Release|Any CPU
{CA488507-3B6E-4494-B7BE-7B4EEEB2C4D1}.ReleaseNETCoreAppnet463-Windows_NTnetcoreapp|AnyCPU.Build.0 = net463-Windows_NT-Release|Any CPU
{CA488507-3B6E-4494-B7BE-7B4EEEB2C4D1}.DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Debug|Any CPU
{CA488507-3B6E-4494-B7BE-7B4EEEB2C4D1}.DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU.Build.0 = netcoreapp-Debug|Any CPU
{CA488507-3B6E-4494-B7BE-7B4EEEB2C4D1}.ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Release|Any CPU
{CA488507-3B6E-4494-B7BE-7B4EEEB2C4D1}.ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU.Build.0 = netcoreapp-Release|Any CPU
{CA488507-3B6E-4494-B7BE-7B4EEEB2C4D1}.DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Debug|Any CPU
{CA488507-3B6E-4494-B7BE-7B4EEEB2C4D1}.DebugNETCoreAppnetcoreappnetcoreapp|AnyCPU.Build.0 = netcoreapp-Debug|Any CPU
{CA488507-3B6E-4494-B7BE-7B4EEEB2C4D1}.ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU.ActiveCfg = netcoreapp-Release|Any CPU
{CA488507-3B6E-4494-B7BE-7B4EEEB2C4D1}.ReleaseNETCoreAppnetcoreappnetcoreapp|AnyCPU.Build.0 = netcoreapp-Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\dir.props" />
<PropertyGroup>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
<IsNETCoreApp>true</IsNETCoreApp>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BuildConfigurations>
netcoreapp;
uap;
</BuildConfigurations>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,198 @@
// 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.
// ------------------------------------------------------------------------------
// Changes to this file must follow the http://aka.ms/api-review process.
// ------------------------------------------------------------------------------
using System;
using System.Collections;
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.NonSerializedAttribute))]
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.SerializableAttribute))]
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Serialization.IDeserializationCallback))]
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Serialization.IFormatterConverter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Serialization.ISerializable))]
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Serialization.SerializationEntry))]
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Serialization.SerializationInfo))]
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Serialization.SerializationInfoEnumerator))]
namespace System.Runtime.Serialization
{
[System.CLSCompliantAttribute(false)]
public abstract partial class Formatter : System.Runtime.Serialization.IFormatter
{
protected System.Runtime.Serialization.ObjectIDGenerator m_idGenerator;
protected System.Collections.Queue m_objectQueue;
protected Formatter() { }
public abstract System.Runtime.Serialization.SerializationBinder Binder { get; set; }
public abstract System.Runtime.Serialization.StreamingContext Context { get; set; }
public abstract System.Runtime.Serialization.ISurrogateSelector SurrogateSelector { get; set; }
public abstract object Deserialize(System.IO.Stream serializationStream);
protected virtual object GetNext(out long objID) { throw null; }
protected virtual long Schedule(object obj) { throw null; }
public abstract void Serialize(System.IO.Stream serializationStream, object graph);
protected abstract void WriteArray(object obj, string name, System.Type memberType);
protected abstract void WriteBoolean(bool val, string name);
protected abstract void WriteByte(byte val, string name);
protected abstract void WriteChar(char val, string name);
protected abstract void WriteDateTime(System.DateTime val, string name);
protected abstract void WriteDecimal(decimal val, string name);
protected abstract void WriteDouble(double val, string name);
protected abstract void WriteInt16(short val, string name);
protected abstract void WriteInt32(int val, string name);
protected abstract void WriteInt64(long val, string name);
protected virtual void WriteMember(string memberName, object data) { }
protected abstract void WriteObjectRef(object obj, string name, System.Type memberType);
[System.CLSCompliantAttribute(false)]
protected abstract void WriteSByte(sbyte val, string name);
protected abstract void WriteSingle(float val, string name);
protected abstract void WriteTimeSpan(System.TimeSpan val, string name);
[System.CLSCompliantAttribute(false)]
protected abstract void WriteUInt16(ushort val, string name);
[System.CLSCompliantAttribute(false)]
protected abstract void WriteUInt32(uint val, string name);
[System.CLSCompliantAttribute(false)]
protected abstract void WriteUInt64(ulong val, string name);
protected abstract void WriteValueType(object obj, string name, System.Type memberType);
}
public partial class FormatterConverter : System.Runtime.Serialization.IFormatterConverter
{
public FormatterConverter() { }
public object Convert(object value, System.Type type) { throw null; }
public object Convert(object value, System.TypeCode typeCode) { throw null; }
public bool ToBoolean(object value) { throw null; }
public byte ToByte(object value) { throw null; }
public char ToChar(object value) { throw null; }
public System.DateTime ToDateTime(object value) { throw null; }
public decimal ToDecimal(object value) { throw null; }
public double ToDouble(object value) { throw null; }
public short ToInt16(object value) { throw null; }
public int ToInt32(object value) { throw null; }
public long ToInt64(object value) { throw null; }
[System.CLSCompliantAttribute(false)]
public sbyte ToSByte(object value) { throw null; }
public float ToSingle(object value) { throw null; }
public string ToString(object value) { throw null; }
[System.CLSCompliantAttribute(false)]
public ushort ToUInt16(object value) { throw null; }
[System.CLSCompliantAttribute(false)]
public uint ToUInt32(object value) { throw null; }
[System.CLSCompliantAttribute(false)]
public ulong ToUInt64(object value) { throw null; }
}
public static partial class FormatterServices
{
public static void CheckTypeSecurity(System.Type t, System.Runtime.Serialization.Formatters.TypeFilterLevel securityLevel) { }
public static object[] GetObjectData(object obj, System.Reflection.MemberInfo[] members) { throw null; }
public static object GetSafeUninitializedObject(System.Type type) { throw null; }
public static System.Reflection.MemberInfo[] GetSerializableMembers(System.Type type) { throw null; }
public static System.Reflection.MemberInfo[] GetSerializableMembers(System.Type type, System.Runtime.Serialization.StreamingContext context) { throw null; }
public static System.Runtime.Serialization.ISerializationSurrogate GetSurrogateForCyclicalReference(System.Runtime.Serialization.ISerializationSurrogate innerSurrogate) { throw null; }
public static System.Type GetTypeFromAssembly(System.Reflection.Assembly assem, string name) { throw null; }
public static object GetUninitializedObject(System.Type type) { throw null; }
public static object PopulateObjectMembers(object obj, System.Reflection.MemberInfo[] members, object[] data) { throw null; }
}
public partial interface IFormatter
{
System.Runtime.Serialization.SerializationBinder Binder { get; set; }
System.Runtime.Serialization.StreamingContext Context { get; set; }
System.Runtime.Serialization.ISurrogateSelector SurrogateSelector { get; set; }
object Deserialize(System.IO.Stream serializationStream);
void Serialize(System.IO.Stream serializationStream, object graph);
}
public partial interface ISerializationSurrogate
{
void GetObjectData(object obj, System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
object SetObjectData(object obj, System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context, System.Runtime.Serialization.ISurrogateSelector selector);
}
public partial interface ISurrogateSelector
{
void ChainSelector(System.Runtime.Serialization.ISurrogateSelector selector);
System.Runtime.Serialization.ISurrogateSelector GetNextSelector();
System.Runtime.Serialization.ISerializationSurrogate GetSurrogate(System.Type type, System.Runtime.Serialization.StreamingContext context, out System.Runtime.Serialization.ISurrogateSelector selector);
}
public partial class ObjectIDGenerator
{
public ObjectIDGenerator() { }
public virtual long GetId(object obj, out bool firstTime) { throw null; }
public virtual long HasId(object obj, out bool firstTime) { throw null; }
}
public partial class ObjectManager
{
public ObjectManager(System.Runtime.Serialization.ISurrogateSelector selector, System.Runtime.Serialization.StreamingContext context) { }
public virtual void DoFixups() { }
public virtual object GetObject(long objectID) { throw null; }
public virtual void RaiseDeserializationEvent() { }
public void RaiseOnDeserializingEvent(object obj) { }
public virtual void RecordArrayElementFixup(long arrayToBeFixed, int index, long objectRequired) { }
public virtual void RecordArrayElementFixup(long arrayToBeFixed, int[] indices, long objectRequired) { }
public virtual void RecordDelayedFixup(long objectToBeFixed, string memberName, long objectRequired) { }
public virtual void RecordFixup(long objectToBeFixed, System.Reflection.MemberInfo member, long objectRequired) { }
public virtual void RegisterObject(object obj, long objectID) { }
public void RegisterObject(object obj, long objectID, System.Runtime.Serialization.SerializationInfo info) { }
public void RegisterObject(object obj, long objectID, System.Runtime.Serialization.SerializationInfo info, long idOfContainingObj, System.Reflection.MemberInfo member) { }
public void RegisterObject(object obj, long objectID, System.Runtime.Serialization.SerializationInfo info, long idOfContainingObj, System.Reflection.MemberInfo member, int[] arrayIndex) { }
}
public abstract partial class SerializationBinder
{
protected SerializationBinder() { }
public virtual void BindToName(System.Type serializedType, out string assemblyName, out string typeName) { throw null; }
public abstract System.Type BindToType(string assemblyName, string typeName);
}
public sealed partial class SerializationObjectManager
{
public SerializationObjectManager(System.Runtime.Serialization.StreamingContext context) { }
public void RaiseOnSerializedEvent() { }
public void RegisterObject(object obj) { }
}
public partial class SurrogateSelector : System.Runtime.Serialization.ISurrogateSelector
{
public SurrogateSelector() { }
public virtual void AddSurrogate(System.Type type, System.Runtime.Serialization.StreamingContext context, System.Runtime.Serialization.ISerializationSurrogate surrogate) { }
public virtual void ChainSelector(System.Runtime.Serialization.ISurrogateSelector selector) { }
public virtual System.Runtime.Serialization.ISurrogateSelector GetNextSelector() { throw null; }
public virtual System.Runtime.Serialization.ISerializationSurrogate GetSurrogate(System.Type type, System.Runtime.Serialization.StreamingContext context, out System.Runtime.Serialization.ISurrogateSelector selector) { throw null; }
public virtual void RemoveSurrogate(System.Type type, System.Runtime.Serialization.StreamingContext context) { }
}
} // end of System.Runtime.Serialization
namespace System.Runtime.Serialization.Formatters
{
public enum FormatterAssemblyStyle
{
Full = 1,
Simple = 0,
}
public enum FormatterTypeStyle
{
TypesAlways = 1,
TypesWhenNeeded = 0,
XsdString = 2,
}
public partial interface IFieldInfo
{
string[] FieldNames { get; set; }
System.Type[] FieldTypes { get; set; }
}
public enum TypeFilterLevel
{
Full = 3,
Low = 2,
}
} // end of System.Runtime.Serialization.Formatters
namespace System.Runtime.Serialization.Formatters.Binary
{
public sealed partial class BinaryFormatter : System.Runtime.Serialization.IFormatter
{
public BinaryFormatter() { }
public BinaryFormatter(System.Runtime.Serialization.ISurrogateSelector selector, System.Runtime.Serialization.StreamingContext context) { }
public System.Runtime.Serialization.Formatters.FormatterAssemblyStyle AssemblyFormat { get { throw null; } set { } }
public System.Runtime.Serialization.SerializationBinder Binder { get { throw null; } set { } }
public System.Runtime.Serialization.StreamingContext Context { get { throw null; } set { } }
public System.Runtime.Serialization.Formatters.TypeFilterLevel FilterLevel { get { throw null; } set { } }
public System.Runtime.Serialization.ISurrogateSelector SurrogateSelector { get { throw null; } set { } }
public System.Runtime.Serialization.Formatters.FormatterTypeStyle TypeFormat { get { throw null; } set { } }
public object Deserialize(System.IO.Stream serializationStream) { throw null; }
public void Serialize(System.IO.Stream serializationStream, object graph) { }
}
} // end of System.Runtime.Serialization.Formatters.Binary

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Release|AnyCPU'" />
<ItemGroup>
<Compile Include="System.Runtime.Serialization.Formatters.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\System.Collections.NonGeneric\ref\System.Collections.NonGeneric.csproj" />
<ProjectReference Include="..\..\System.IO\ref\System.IO.csproj" />
<ProjectReference Include="..\..\System.Reflection\ref\System.Reflection.csproj" />
<ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
<ProjectReference Include="..\..\System.Runtime.Extensions\ref\System.Runtime.Extensions.csproj" />
<ProjectReference Include="..\..\System.Runtime.Serialization.Primitives\ref\System.Runtime.Serialization.Primitives.csproj" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
</Project>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BuildConfigurations>
net463-Windows_NT;
netcoreapp;
</BuildConfigurations>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,330 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Serialization_OptionalFieldVersionValue" xml:space="preserve">
<value>Version value must be positive.</value>
</data>
<data name="Serialization_SameNameTwice" xml:space="preserve">
<value>Cannot add the same member twice to a SerializationInfo object.</value>
</data>
<data name="Serialization_NotFound" xml:space="preserve">
<value>Member '{0}' was not found.</value>
</data>
<data name="InvalidOperation_EnumOpCantHappen" xml:space="preserve">
<value>Enumeration has either not started or has already finished.</value>
</data>
<data name="Serialization_NonSerType" xml:space="preserve">
<value>Type '{0}' in Assembly '{1}' is not marked as serializable.</value>
</data>
<data name="Argument_DataLengthDifferent" xml:space="preserve">
<value>Parameters 'members' and 'data' must have the same length.</value>
</data>
<data name="ArgumentNull_NullMember" xml:space="preserve">
<value>Member at position {0} was null.</value>
</data>
<data name="Serialization_UnknownMemberInfo" xml:space="preserve">
<value>Only FieldInfo, PropertyInfo, and SerializationMemberInfo are recognized.</value>
</data>
<data name="Serialization_NoID" xml:space="preserve">
<value>Object has never been assigned an objectID.</value>
</data>
<data name="Serialization_TooManyElements" xml:space="preserve">
<value>The internal array cannot expand to greater than Int32.MaxValue elements.</value>
</data>
<data name="Argument_InvalidFieldInfo" xml:space="preserve">
<value>The FieldInfo object is not valid.</value>
</data>
<data name="Serialization_NeverSeen" xml:space="preserve">
<value>A fixup is registered to the object with ID {0}, but the object does not appear in the graph.</value>
</data>
<data name="Serialization_IORIncomplete" xml:space="preserve">
<value>The object with ID {0} implements the IObjectReference interface for which all dependencies cannot be resolved. The likely cause is two instances of IObjectReference that have a mutual dependency on each other.</value>
</data>
<data name="Serialization_ObjectNotSupplied" xml:space="preserve">
<value>The object with ID {0} was referenced in a fixup but does not exist.</value>
</data>
<data name="Serialization_NotCyclicallyReferenceableSurrogate" xml:space="preserve">
<value>{0}.SetObjectData returns a value that is neither null nor equal to the first parameter. Such Surrogates cannot be part of cyclical reference.</value>
</data>
<data name="Serialization_TooManyReferences" xml:space="preserve">
<value>The implementation of the IObjectReference interface returns too many nested references to other objects that implement IObjectReference.</value>
</data>
<data name="Serialization_MissingObject" xml:space="preserve">
<value>The object with ID {0} was referenced in a fixup but has not been registered.</value>
</data>
<data name="Serialization_InvalidFixupDiscovered" xml:space="preserve">
<value>A fixup on an object implementing ISerializable or having a surrogate was discovered for an object which does not have a SerializationInfo available.</value>
</data>
<data name="Serialization_TypeLoadFailure" xml:space="preserve">
<value>Unable to load type {0} required for deserialization.</value>
</data>
<data name="Serialization_ValueTypeFixup" xml:space="preserve">
<value>ValueType fixup on Arrays is not implemented.</value>
</data>
<data name="Serialization_PartialValueTypeFixup" xml:space="preserve">
<value>Fixing up a partially available ValueType chain is not implemented.</value>
</data>
<data name="Serialization_UnableToFixup" xml:space="preserve">
<value>Cannot perform fixup.</value>
</data>
<data name="ArgumentOutOfRange_ObjectID" xml:space="preserve">
<value>objectID cannot be less than or equal to zero.</value>
</data>
<data name="Serialization_RegisterTwice" xml:space="preserve">
<value>An object cannot be registered twice.</value>
</data>
<data name="Serialization_NotISer" xml:space="preserve">
<value>The given object does not implement the ISerializable interface.</value>
</data>
<data name="Serialization_ConstructorNotFound" xml:space="preserve">
<value>The constructor to deserialize an object of type '{0}' was not found.</value>
</data>
<data name="Serialization_IncorrectNumberOfFixups" xml:space="preserve">
<value>The ObjectManager found an invalid number of fixups. This usually indicates a problem in the Formatter.</value>
</data>
<data name="Serialization_InvalidFixupType" xml:space="preserve">
<value>A member fixup was registered for an object which implements ISerializable or has a surrogate. In this situation, a delayed fixup must be used.</value>
</data>
<data name="Serialization_IdTooSmall" xml:space="preserve">
<value>Object IDs must be greater than zero.</value>
</data>
<data name="Serialization_ParentChildIdentical" xml:space="preserve">
<value>The ID of the containing object cannot be the same as the object ID.</value>
</data>
<data name="Serialization_InvalidType" xml:space="preserve">
<value>Only system-provided types can be passed to the GetUninitializedObject method. '{0}' is not a valid instance of a type.</value>
</data>
<data name="Arg_ArrayZeroError" xml:space="preserve">
<value>Array must not be of length zero.</value>
</data>
<data name="Argument_MustSupplyParent" xml:space="preserve">
<value>When supplying the ID of a containing object, the FieldInfo that identifies the current field within that object must also be supplied.</value>
</data>
<data name="Argument_MemberAndArray" xml:space="preserve">
<value>Cannot supply both a MemberInfo and an Array to indicate the parent of a value type.</value>
</data>
<data name="Serialization_CorruptedStream" xml:space="preserve">
<value>Invalid BinaryFormatter stream.</value>
</data>
<data name="Serialization_HeaderReflection" xml:space="preserve">
<value>Header reflection error: number of value members: {0}.</value>
</data>
<data name="Serialization_Stream" xml:space="preserve">
<value>Attempting to deserialize an empty stream.</value>
</data>
<data name="Serialization_BinaryHeader" xml:space="preserve">
<value>Binary stream '{0}' does not contain a valid BinaryHeader. Possible causes are invalid stream or object version change between serialization and deserialization.</value>
</data>
<data name="Serialization_TypeExpected" xml:space="preserve">
<value>Invalid expected type.</value>
</data>
<data name="Serialization_StreamEnd" xml:space="preserve">
<value>End of Stream encountered before parsing was completed.</value>
</data>
<data name="Serialization_CrossAppDomainError" xml:space="preserve">
<value>Cross-AppDomain BinaryFormatter error; expected '{0}' but received '{1}'.</value>
</data>
<data name="Serialization_Map" xml:space="preserve">
<value>No map for object '{0}'.</value>
</data>
<data name="Serialization_Assembly" xml:space="preserve">
<value>No assembly information is available for object on the wire, '{0}'.</value>
</data>
<data name="Serialization_ObjectTypeEnum" xml:space="preserve">
<value>Invalid ObjectTypeEnum {0}.</value>
</data>
<data name="Serialization_AssemblyId" xml:space="preserve">
<value>No assembly ID for object type '{0}'.</value>
</data>
<data name="Serialization_ArrayType" xml:space="preserve">
<value>Invalid array type '{0}'.</value>
</data>
<data name="Serialization_TypeCode" xml:space="preserve">
<value>Invalid type code in stream '{0}'.</value>
</data>
<data name="Serialization_TypeWrite" xml:space="preserve">
<value>Invalid write type request '{0}'.</value>
</data>
<data name="Serialization_TypeRead" xml:space="preserve">
<value>Invalid read type request '{0}'.</value>
</data>
<data name="Serialization_AssemblyNotFound" xml:space="preserve">
<value>Unable to find assembly '{0}'.</value>
</data>
<data name="Serialization_InvalidFormat" xml:space="preserve">
<value>The input stream is not a valid binary format. The starting contents (in bytes) are: {0} ...</value>
</data>
<data name="Serialization_TopObject" xml:space="preserve">
<value>No top object.</value>
</data>
<data name="Serialization_XMLElement" xml:space="preserve">
<value>Invalid element '{0}'.</value>
</data>
<data name="Serialization_TopObjectInstantiate" xml:space="preserve">
<value>Top object cannot be instantiated for element '{0}'.</value>
</data>
<data name="Serialization_ArrayTypeObject" xml:space="preserve">
<value>Array element type is Object, 'dt' attribute is null.</value>
</data>
<data name="Serialization_TypeMissing" xml:space="preserve">
<value>Type is missing for member of type Object '{0}'.</value>
</data>
<data name="Serialization_ObjNoID" xml:space="preserve">
<value>Object {0} has never been assigned an objectID.</value>
</data>
<data name="Serialization_SerMemberInfo" xml:space="preserve">
<value>MemberInfo type {0} cannot be serialized.</value>
</data>
<data name="Argument_MustSupplyContainer" xml:space="preserve">
<value>When supplying a FieldInfo for fixing up a nested type, a valid ID for that containing object must also be supplied.</value>
</data>
<data name="Serialization_ParseError" xml:space="preserve">
<value>Parse error. Current element is not compatible with the next element, {0}.</value>
</data>
<data name="Serialization_ISerializableMemberInfo" xml:space="preserve">
<value>MemberInfo requested for ISerializable type.</value>
</data>
<data name="Serialization_MemberInfo" xml:space="preserve">
<value>MemberInfo cannot be obtained for ISerialized Object '{0}'.</value>
</data>
<data name="Serialization_ISerializableTypes" xml:space="preserve">
<value>Types not available for ISerializable object '{0}'.</value>
</data>
<data name="Serialization_MissingMember" xml:space="preserve">
<value>Member '{0}' in class '{1}' is not present in the serialized stream and is not marked with {2}.</value>
</data>
<data name="Serialization_NoMemberInfo" xml:space="preserve">
<value>No MemberInfo for Object {0}.</value>
</data>
<data name="Serialization_TypeSecurity" xml:space="preserve">
<value>Selector is already on the list of checked selectors.</value>
</data>
<data name="Serialization_DuplicateSelector" xml:space="preserve">
<value>Type {0} and the types derived from it (such as {1}) are not permitted to be deserialized at this security level.</value>
</data>
<data name="Serialization_SurrogateCycleInArgument" xml:space="preserve">
<value>Selector contained a cycle.</value>
</data>
<data name="Serialization_SurrogateCycle" xml:space="preserve">
<value>Adding selector will introduce a cycle.</value>
</data>
<data name="IO_EOF_ReadBeyondEOF" xml:space="preserve">
<value>Unable to read beyond the end of the stream.</value>
</data>
</root>

View File

@@ -0,0 +1,12 @@
// 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.
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.NonSerializedAttribute))]
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.SerializableAttribute))]
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Serialization.IDeserializationCallback))]
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Serialization.IFormatterConverter))]
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Serialization.ISerializable))]
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Serialization.SerializationEntry))]
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Serialization.SerializationInfo))]
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Runtime.Serialization.SerializationInfoEnumerator))]

View File

@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<ProjectGuid>{CA488507-3B6E-4494-B7BE-7B4EEEB2C4D1}</ProjectGuid>
<AssemblyName>System.Runtime.Serialization.Formatters</AssemblyName>
<RootNamespace>System.Runtime.Serialization.Formatters</RootNamespace>
<IsPartialFacadeAssembly Condition="'$(TargetGroup)' == 'net463'">true</IsPartialFacadeAssembly>
<DefineConstants Condition="'$(TargetGroup)' == 'netcoreapp'">$(DefineConstants);netcoreapp11</DefineConstants>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='net463-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='net463-Windows_NT-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='netcoreapp-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='netcoreapp-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='netcoreapp-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='netcoreapp-Release|AnyCPU'" />
<ItemGroup Condition="'$(TargetGroup)' != 'net463'">
<Compile Include="System.Runtime.Serialization.Formatters.TypeForwards.cs" />
<Compile Include="System\TemporaryStubs.cs" />
<Compile Include="System\Runtime\Serialization\DeserializationEventHandler.cs" />
<Compile Include="System\Runtime\Serialization\Formatter.cs" />
<Compile Include="System\Runtime\Serialization\FormatterConverter.cs" />
<Compile Include="System\Runtime\Serialization\FormatterServices.cs" />
<Compile Include="System\Runtime\Serialization\IFormatter.cs" />
<Compile Include="System\Runtime\Serialization\ISerializationSurrogate.cs" />
<Compile Include="System\Runtime\Serialization\ISurrogateSelector.cs" />
<Compile Include="System\Runtime\Serialization\MemberHolder.cs" />
<Compile Include="System\Runtime\Serialization\ObjectIDGenerator.cs" />
<Compile Include="System\Runtime\Serialization\ObjectManager.cs" />
<Compile Include="System\Runtime\Serialization\SerializationBinder.cs" />
<Compile Include="System\Runtime\Serialization\SerializationEventsCache.cs" />
<Compile Include="System\Runtime\Serialization\SerializationObjectManager.cs" />
<Compile Include="System\Runtime\Serialization\SurrogateSelector.cs" />
<Compile Include="System\Runtime\Serialization\ValueTypeFixupInfo.cs" />
<Compile Include="System\Runtime\Serialization\Formatters\CommonEnums.cs" />
<Compile Include="System\Runtime\Serialization\Formatters\IFieldInfo.cs" />
<Compile Include="System\Runtime\Serialization\Formatters\Binary\BinaryArray.cs" />
<Compile Include="System\Runtime\Serialization\Formatters\Binary\BinaryAssembly.cs" />
<Compile Include="System\Runtime\Serialization\Formatters\Binary\BinaryAssemblyInfo.cs" />
<Compile Include="System\Runtime\Serialization\Formatters\Binary\BinaryTypeConverter.cs" />
<Compile Include="System\Runtime\Serialization\Formatters\Binary\BinaryCrossAppDomainAssembly.cs" />
<Compile Include="System\Runtime\Serialization\Formatters\Binary\BinaryCrossAppDomainMap.cs" />
<Compile Include="System\Runtime\Serialization\Formatters\Binary\BinaryCrossAppDomainString.cs" />
<Compile Include="System\Runtime\Serialization\Formatters\Binary\BinaryObject.cs" />
<Compile Include="System\Runtime\Serialization\Formatters\Binary\BinaryObjectString.cs" />
<Compile Include="System\Runtime\Serialization\Formatters\Binary\BinaryObjectWithMap.cs" />
<Compile Include="System\Runtime\Serialization\Formatters\Binary\BinaryObjectWithMapTyped.cs" />
<Compile Include="System\Runtime\Serialization\Formatters\Binary\IStreamable.cs" />
<Compile Include="System\Runtime\Serialization\Formatters\Binary\MemberPrimitiveTyped.cs" />
<Compile Include="System\Runtime\Serialization\Formatters\Binary\MemberPrimitiveUntyped.cs" />
<Compile Include="System\Runtime\Serialization\Formatters\Binary\MemberReference.cs" />
<Compile Include="System\Runtime\Serialization\Formatters\Binary\MessageEnd.cs" />
<Compile Include="System\Runtime\Serialization\Formatters\Binary\ObjectMap.cs" />
<Compile Include="System\Runtime\Serialization\Formatters\Binary\ObjectNull.cs" />
<Compile Include="System\Runtime\Serialization\Formatters\Binary\SerializationHeaderRecord.cs" />
<Compile Include="System\Runtime\Serialization\Formatters\Binary\ObjectProgress.cs" />
<Compile Include="System\Runtime\Serialization\Formatters\Binary\Converter.cs" />
<Compile Include="System\Runtime\Serialization\Formatters\Binary\BinaryEnums.cs" />
<Compile Include="System\Runtime\Serialization\Formatters\Binary\BinaryFormatter.cs" />
<Compile Include="System\Runtime\Serialization\Formatters\Binary\BinaryFormatterWriter.cs" />
<Compile Include="System\Runtime\Serialization\Formatters\Binary\BinaryObjectInfo.cs" />
<Compile Include="System\Runtime\Serialization\Formatters\Binary\BinaryObjectReader.cs" />
<Compile Include="System\Runtime\Serialization\Formatters\Binary\BinaryObjectWriter.cs" />
<Compile Include="System\Runtime\Serialization\Formatters\Binary\BinaryParser.cs" />
<Compile Include="System\Runtime\Serialization\Formatters\Binary\BinaryUtilClasses.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="System.Collections" />
<Reference Include="System.Collections.Concurrent" />
<Reference Include="System.Collections.NonGeneric" />
<Reference Include="System.Diagnostics.Debug" />
<Reference Include="System.Resources.ResourceManager" />
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.Extensions" />
<Reference Include="System.Text.Encoding.Extensions" />
<Reference Include="System.Threading" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
</Project>

View File

@@ -0,0 +1,12 @@
// 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.
namespace System.Runtime.Serialization
{
[Serializable]
internal delegate void DeserializationEventHandler(object sender);
[Serializable]
internal delegate void SerializationEventHandler(StreamingContext context);
}

View File

@@ -0,0 +1,192 @@
// 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.IO;
using System.Globalization;
using System.Collections;
using System.Reflection;
namespace System.Runtime.Serialization
{
[Serializable]
[CLSCompliant(false)]
public abstract class Formatter : IFormatter
{
protected ObjectIDGenerator m_idGenerator;
protected Queue m_objectQueue;
protected Formatter()
{
m_objectQueue = new Queue();
m_idGenerator = new ObjectIDGenerator();
}
public abstract object Deserialize(Stream serializationStream);
protected virtual object GetNext(out long objID)
{
if (m_objectQueue.Count == 0)
{
objID = 0;
return null;
}
object obj = m_objectQueue.Dequeue();
bool isNew;
objID = m_idGenerator.HasId(obj, out isNew);
if (isNew)
{
throw new SerializationException(SR.Serialization_NoID);
}
return obj;
}
protected virtual long Schedule(object obj)
{
if (obj == null)
{
return 0;
}
bool isNew;
long id = m_idGenerator.GetId(obj, out isNew);
if (isNew)
{
m_objectQueue.Enqueue(obj);
}
return id;
}
public abstract void Serialize(Stream serializationStream, object graph);
protected abstract void WriteArray(object obj, string name, Type memberType);
protected abstract void WriteBoolean(bool val, string name);
protected abstract void WriteByte(byte val, string name);
protected abstract void WriteChar(char val, string name);
protected abstract void WriteDateTime(DateTime val, string name);
protected abstract void WriteDecimal(decimal val, string name);
protected abstract void WriteDouble(double val, string name);
protected abstract void WriteInt16(short val, string name);
protected abstract void WriteInt32(int val, string name);
protected abstract void WriteInt64(long val, string name);
protected abstract void WriteObjectRef(object obj, string name, Type memberType);
protected virtual void WriteMember(string memberName, object data)
{
if (data == null)
{
WriteObjectRef(data, memberName, typeof(object));
return;
}
Type varType = data.GetType();
if (varType == typeof(bool))
{
WriteBoolean(Convert.ToBoolean(data, CultureInfo.InvariantCulture), memberName);
}
else if (varType == typeof(char))
{
WriteChar(Convert.ToChar(data, CultureInfo.InvariantCulture), memberName);
}
else if (varType == typeof(sbyte))
{
WriteSByte(Convert.ToSByte(data, CultureInfo.InvariantCulture), memberName);
}
else if (varType == typeof(byte))
{
WriteByte(Convert.ToByte(data, CultureInfo.InvariantCulture), memberName);
}
else if (varType == typeof(short))
{
WriteInt16(Convert.ToInt16(data, CultureInfo.InvariantCulture), memberName);
}
else if (varType == typeof(int))
{
WriteInt32(Convert.ToInt32(data, CultureInfo.InvariantCulture), memberName);
}
else if (varType == typeof(long))
{
WriteInt64(Convert.ToInt64(data, CultureInfo.InvariantCulture), memberName);
}
else if (varType == typeof(float))
{
WriteSingle(Convert.ToSingle(data, CultureInfo.InvariantCulture), memberName);
}
else if (varType == typeof(double))
{
WriteDouble(Convert.ToDouble(data, CultureInfo.InvariantCulture), memberName);
}
else if (varType == typeof(DateTime))
{
WriteDateTime(Convert.ToDateTime(data, CultureInfo.InvariantCulture), memberName);
}
else if (varType == typeof(decimal))
{
WriteDecimal(Convert.ToDecimal(data, CultureInfo.InvariantCulture), memberName);
}
else if (varType == typeof(ushort))
{
WriteUInt16(Convert.ToUInt16(data, CultureInfo.InvariantCulture), memberName);
}
else if (varType == typeof(uint))
{
WriteUInt32(Convert.ToUInt32(data, CultureInfo.InvariantCulture), memberName);
}
else if (varType == typeof(ulong))
{
WriteUInt64(Convert.ToUInt64(data, CultureInfo.InvariantCulture), memberName);
}
else if (varType.IsArray)
{
WriteArray(data, memberName, varType);
}
else if (varType.IsValueType)
{
WriteValueType(data, memberName, varType);
}
else
{
WriteObjectRef(data, memberName, varType);
}
}
[CLSCompliant(false)]
protected abstract void WriteSByte(sbyte val, string name);
protected abstract void WriteSingle(float val, string name);
protected abstract void WriteTimeSpan(TimeSpan val, string name);
[CLSCompliant(false)]
protected abstract void WriteUInt16(ushort val, string name);
[CLSCompliant(false)]
protected abstract void WriteUInt32(uint val, string name);
[CLSCompliant(false)]
protected abstract void WriteUInt64(ulong val, string name);
protected abstract void WriteValueType(object obj, string name, Type memberType);
public abstract ISurrogateSelector SurrogateSelector { get; set; }
public abstract SerializationBinder Binder { get; set; }
public abstract StreamingContext Context { get; set; }
}
}

View File

@@ -0,0 +1,124 @@
// 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.Globalization;
using System.Runtime.CompilerServices;
namespace System.Runtime.Serialization
{
public class FormatterConverter : IFormatterConverter
{
public object Convert(object value, Type type)
{
if (value == null) ThrowValueNullException();
return System.Convert.ChangeType(value, type, CultureInfo.InvariantCulture);
}
public object Convert(object value, TypeCode typeCode)
{
if (value == null) ThrowValueNullException();
return System.Convert.ChangeType(value, typeCode, CultureInfo.InvariantCulture);
}
public bool ToBoolean(object value)
{
if (value == null) ThrowValueNullException();
return System.Convert.ToBoolean(value, CultureInfo.InvariantCulture);
}
public char ToChar(object value)
{
if (value == null) ThrowValueNullException();
return System.Convert.ToChar(value, CultureInfo.InvariantCulture);
}
[CLSCompliant(false)]
public sbyte ToSByte(object value)
{
if (value == null) ThrowValueNullException();
return System.Convert.ToSByte(value, CultureInfo.InvariantCulture);
}
public byte ToByte(object value)
{
if (value == null) ThrowValueNullException();
return System.Convert.ToByte(value, CultureInfo.InvariantCulture);
}
public short ToInt16(object value)
{
if (value == null) ThrowValueNullException();
return System.Convert.ToInt16(value, CultureInfo.InvariantCulture);
}
[CLSCompliant(false)]
public ushort ToUInt16(object value)
{
if (value == null) ThrowValueNullException();
return System.Convert.ToUInt16(value, CultureInfo.InvariantCulture);
}
public int ToInt32(object value)
{
if (value == null) ThrowValueNullException();
return System.Convert.ToInt32(value, CultureInfo.InvariantCulture);
}
[CLSCompliant(false)]
public uint ToUInt32(object value)
{
if (value == null) ThrowValueNullException();
return System.Convert.ToUInt32(value, CultureInfo.InvariantCulture);
}
public long ToInt64(object value)
{
if (value == null) ThrowValueNullException();
return System.Convert.ToInt64(value, CultureInfo.InvariantCulture);
}
[CLSCompliant(false)]
public ulong ToUInt64(object value)
{
if (value == null) ThrowValueNullException();
return System.Convert.ToUInt64(value, CultureInfo.InvariantCulture);
}
public float ToSingle(object value)
{
if (value == null) ThrowValueNullException();
return System.Convert.ToSingle(value, CultureInfo.InvariantCulture);
}
public double ToDouble(object value)
{
if (value == null) ThrowValueNullException();
return System.Convert.ToDouble(value, CultureInfo.InvariantCulture);
}
public decimal ToDecimal(object value)
{
if (value == null) ThrowValueNullException();
return System.Convert.ToDecimal(value, CultureInfo.InvariantCulture);
}
public DateTime ToDateTime(object value)
{
if (value == null) ThrowValueNullException();
return System.Convert.ToDateTime(value, CultureInfo.InvariantCulture);
}
public string ToString(object value)
{
if (value == null) ThrowValueNullException();
return System.Convert.ToString(value, CultureInfo.InvariantCulture);
}
[MethodImpl(MethodImplOptions.NoInlining)]
private static void ThrowValueNullException()
{
throw new ArgumentNullException("value");
}
}
}

View File

@@ -0,0 +1,297 @@
// 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.Reflection;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Text;
using System.Globalization;
using System.Diagnostics;
using System.Runtime.Serialization.Formatters;
namespace System.Runtime.Serialization
{
public static class FormatterServices
{
private static readonly ConcurrentDictionary<MemberHolder, MemberInfo[]> s_memberInfoTable = new ConcurrentDictionary<MemberHolder, MemberInfo[]>();
private static FieldInfo[] GetSerializableFields(Type type)
{
if (type.IsInterface)
{
return Array.Empty<FieldInfo>();
}
if (!type.IsSerializable)
{
throw new SerializationException(SR.Format(SR.Serialization_NonSerType, type.FullName, type.Assembly.FullName));
}
var results = new List<FieldInfo>();
for (Type t = type; t != typeof(object); t = t.BaseType)
{
foreach (FieldInfo field in t.GetFields(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly))
{
if ((field.Attributes & FieldAttributes.NotSerialized) != FieldAttributes.NotSerialized)
{
results.Add(field);
}
}
}
return results.ToArray();
}
public static MemberInfo[] GetSerializableMembers(Type type)
{
return GetSerializableMembers(type, new StreamingContext(StreamingContextStates.All));
}
public static MemberInfo[] GetSerializableMembers(Type type, StreamingContext context)
{
if (type == null)
{
throw new ArgumentNullException(nameof(type));
}
// If we've already gathered the members for this type, just return them.
// Otherwise, get them and add them.
return s_memberInfoTable.GetOrAdd(
new MemberHolder(type, context),
mh => GetSerializableFields(mh._memberType));
}
public static void CheckTypeSecurity(Type t, TypeFilterLevel securityLevel)
{
// nop
}
#if !netcoreapp11
private static readonly Func<Type, object> s_getUninitializedObjectDelegate = (Func<Type, object>)
typeof(string).Assembly
.GetType("System.Runtime.Serialization.FormatterServices")
.GetMethod("GetUninitializedObject", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static)
.CreateDelegate(typeof(Func<Type, object>));
#endif // netcoreapp11
public static object GetUninitializedObject(Type type)
{
if (type == null)
{
throw new ArgumentNullException(nameof(type));
}
#if netcoreapp11
return RuntimeHelpers.GetUninitializedObject(type);
#else
return s_getUninitializedObjectDelegate(type);
#endif // netcoreapp11
}
public static object GetSafeUninitializedObject(Type type) => GetUninitializedObject(type);
internal static void SerializationSetValue(MemberInfo fi, object target, object value)
{
Debug.Assert(fi != null);
var serField = fi as FieldInfo;
if (serField != null)
{
serField.SetValue(target, value);
return;
}
throw new ArgumentException(SR.Argument_InvalidFieldInfo);
}
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(SR.Argument_DataLengthDifferent);
}
for (int i = 0; i < members.Length; i++)
{
MemberInfo member = members[i];
if (member == null)
{
throw new ArgumentNullException(nameof(members), SR.Format(SR.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.
object value = data[i];
if (value == null)
{
continue;
}
// If it's a field, set its value.
FieldInfo field = member as FieldInfo;
if (field != null)
{
field.SetValue(obj, data[i]);
continue;
}
// Otherwise, it's not supported.
throw new SerializationException(SR.Serialization_UnknownMemberInfo);
}
return obj;
}
public static object[] GetObjectData(object obj, MemberInfo[] members)
{
if (obj == null)
{
throw new ArgumentNullException(nameof(obj));
}
if (members == null)
{
throw new ArgumentNullException(nameof(members));
}
object[] data = new object[members.Length];
for (int i = 0; i < members.Length; i++)
{
MemberInfo member = members[i];
if (member == null)
{
throw new ArgumentNullException(nameof(members), SR.Format(SR.ArgumentNull_NullMember, i));
}
FieldInfo field = member as FieldInfo;
if (field == null)
{
throw new SerializationException(SR.Serialization_UnknownMemberInfo);
}
data[i] = field.GetValue(obj);
}
return data;
}
public static ISerializationSurrogate GetSurrogateForCyclicalReference(ISerializationSurrogate innerSurrogate)
{
if (innerSurrogate == null)
{
throw new ArgumentNullException(nameof(innerSurrogate));
}
return new SurrogateForCyclicalReference(innerSurrogate);
}
public static Type GetTypeFromAssembly(Assembly assem, string name)
{
if (assem == null)
{
throw new ArgumentNullException(nameof(assem));
}
return assem.GetType(name, throwOnError: false, ignoreCase: false);
}
internal static Assembly LoadAssemblyFromString(string assemblyName)
{
return Assembly.Load(new AssemblyName(assemblyName));
}
internal static Assembly LoadAssemblyFromStringNoThrow(string assemblyName)
{
try
{
return LoadAssemblyFromString(assemblyName);
}
catch (Exception) { }
return null;
}
internal static string GetClrAssemblyName(Type type, out bool hasTypeForwardedFrom)
{
if (type == null)
{
throw new ArgumentNullException(nameof(type));
}
foreach (Attribute first in type.GetCustomAttributes(typeof(TypeForwardedFromAttribute), false))
{
hasTypeForwardedFrom = true;
return ((TypeForwardedFromAttribute)first).AssemblyFullName;
}
hasTypeForwardedFrom = false;
return type.Assembly.FullName;
}
internal static string GetClrTypeFullName(Type type)
{
return type.IsArray ?
GetClrTypeFullNameForArray(type) :
GetClrTypeFullNameForNonArrayTypes(type);
}
private static string GetClrTypeFullNameForArray(Type type)
{
int rank = type.GetArrayRank();
Debug.Assert(rank >= 1);
string typeName = GetClrTypeFullName(type.GetElementType());
return rank == 1 ?
typeName + "[]" :
typeName + "[" + new string(',', rank - 1) + "]";
}
private static string GetClrTypeFullNameForNonArrayTypes(Type type)
{
if (!type.IsGenericType)
{
return type.FullName;
}
var builder = new StringBuilder(type.GetGenericTypeDefinition().FullName).Append("[");
bool hasTypeForwardedFrom;
foreach (Type genericArgument in type.GetGenericArguments())
{
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
{
private readonly ISerializationSurrogate _innerSurrogate;
internal SurrogateForCyclicalReference(ISerializationSurrogate innerSurrogate)
{
Debug.Assert(innerSurrogate != null);
_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);
}
}
}

View File

@@ -0,0 +1,158 @@
// 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.
namespace System.Runtime.Serialization.Formatters.Binary
{
internal sealed class BinaryArray : IStreamable
{
internal int _objectId;
internal int _rank;
internal int[] _lengthA;
internal int[] _lowerBoundA;
internal BinaryTypeEnum _binaryTypeEnum;
internal object _typeInformation;
internal int _assemId = 0;
private BinaryHeaderEnum _binaryHeaderEnum;
internal BinaryArrayTypeEnum _binaryArrayTypeEnum;
internal BinaryArray() { }
internal BinaryArray(BinaryHeaderEnum binaryHeaderEnum)
{
_binaryHeaderEnum = binaryHeaderEnum;
}
internal void Set(int objectId, int rank, int[] lengthA, int[] lowerBoundA, BinaryTypeEnum binaryTypeEnum, object typeInformation, BinaryArrayTypeEnum binaryArrayTypeEnum, int assemId)
{
_objectId = objectId;
_binaryArrayTypeEnum = binaryArrayTypeEnum;
_rank = rank;
_lengthA = lengthA;
_lowerBoundA = lowerBoundA;
_binaryTypeEnum = binaryTypeEnum;
_typeInformation = typeInformation;
_assemId = assemId;
_binaryHeaderEnum = BinaryHeaderEnum.Array;
if (binaryArrayTypeEnum == BinaryArrayTypeEnum.Single)
{
if (binaryTypeEnum == BinaryTypeEnum.Primitive)
{
_binaryHeaderEnum = BinaryHeaderEnum.ArraySinglePrimitive;
}
else if (binaryTypeEnum == BinaryTypeEnum.String)
{
_binaryHeaderEnum = BinaryHeaderEnum.ArraySingleString;
}
else if (binaryTypeEnum == BinaryTypeEnum.Object)
{
_binaryHeaderEnum = BinaryHeaderEnum.ArraySingleObject;
}
}
}
public void Write(BinaryFormatterWriter output)
{
switch (_binaryHeaderEnum)
{
case BinaryHeaderEnum.ArraySinglePrimitive:
output.WriteByte((byte)_binaryHeaderEnum);
output.WriteInt32(_objectId);
output.WriteInt32(_lengthA[0]);
output.WriteByte((byte)((InternalPrimitiveTypeE)_typeInformation));
break;
case BinaryHeaderEnum.ArraySingleString:
output.WriteByte((byte)_binaryHeaderEnum);
output.WriteInt32(_objectId);
output.WriteInt32(_lengthA[0]);
break;
case BinaryHeaderEnum.ArraySingleObject:
output.WriteByte((byte)_binaryHeaderEnum);
output.WriteInt32(_objectId);
output.WriteInt32(_lengthA[0]);
break;
default:
output.WriteByte((byte)_binaryHeaderEnum);
output.WriteInt32(_objectId);
output.WriteByte((byte)_binaryArrayTypeEnum);
output.WriteInt32(_rank);
for (int i = 0; i < _rank; i++)
{
output.WriteInt32(_lengthA[i]);
}
if ((_binaryArrayTypeEnum == BinaryArrayTypeEnum.SingleOffset) ||
(_binaryArrayTypeEnum == BinaryArrayTypeEnum.JaggedOffset) ||
(_binaryArrayTypeEnum == BinaryArrayTypeEnum.RectangularOffset))
{
for (int i = 0; i < _rank; i++)
{
output.WriteInt32(_lowerBoundA[i]);
}
}
output.WriteByte((byte)_binaryTypeEnum);
BinaryTypeConverter.WriteTypeInfo(_binaryTypeEnum, _typeInformation, _assemId, output);
break;
}
}
public void Read(BinaryParser input)
{
switch (_binaryHeaderEnum)
{
case BinaryHeaderEnum.ArraySinglePrimitive:
_objectId = input.ReadInt32();
_lengthA = new int[1];
_lengthA[0] = input.ReadInt32();
_binaryArrayTypeEnum = BinaryArrayTypeEnum.Single;
_rank = 1;
_lowerBoundA = new int[_rank];
_binaryTypeEnum = BinaryTypeEnum.Primitive;
_typeInformation = (InternalPrimitiveTypeE)input.ReadByte();
break;
case BinaryHeaderEnum.ArraySingleString:
_objectId = input.ReadInt32();
_lengthA = new int[1];
_lengthA[0] = input.ReadInt32();
_binaryArrayTypeEnum = BinaryArrayTypeEnum.Single;
_rank = 1;
_lowerBoundA = new int[_rank];
_binaryTypeEnum = BinaryTypeEnum.String;
_typeInformation = null;
break;
case BinaryHeaderEnum.ArraySingleObject:
_objectId = input.ReadInt32();
_lengthA = new int[1];
_lengthA[0] = input.ReadInt32();
_binaryArrayTypeEnum = BinaryArrayTypeEnum.Single;
_rank = 1;
_lowerBoundA = new int[_rank];
_binaryTypeEnum = BinaryTypeEnum.Object;
_typeInformation = null;
break;
default:
_objectId = input.ReadInt32();
_binaryArrayTypeEnum = (BinaryArrayTypeEnum)input.ReadByte();
_rank = input.ReadInt32();
_lengthA = new int[_rank];
_lowerBoundA = new int[_rank];
for (int i = 0; i < _rank; i++)
{
_lengthA[i] = input.ReadInt32();
}
if ((_binaryArrayTypeEnum == BinaryArrayTypeEnum.SingleOffset) ||
(_binaryArrayTypeEnum == BinaryArrayTypeEnum.JaggedOffset) ||
(_binaryArrayTypeEnum == BinaryArrayTypeEnum.RectangularOffset))
{
for (int i = 0; i < _rank; i++)
{
_lowerBoundA[i] = input.ReadInt32();
}
}
_binaryTypeEnum = (BinaryTypeEnum)input.ReadByte();
_typeInformation = BinaryTypeConverter.ReadTypeInfo(_binaryTypeEnum, input, out _assemId);
break;
}
}
}
}

View File

@@ -0,0 +1,33 @@
// 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.
namespace System.Runtime.Serialization.Formatters.Binary
{
internal sealed class BinaryAssembly : IStreamable
{
internal int _assemId;
internal string _assemblyString;
internal BinaryAssembly() { }
internal void Set(int assemId, string assemblyString)
{
_assemId = assemId;
_assemblyString = assemblyString;
}
public void Write(BinaryFormatterWriter output)
{
output.WriteByte((byte)BinaryHeaderEnum.Assembly);
output.WriteInt32(_assemId);
output.WriteString(_assemblyString);
}
public void Read(BinaryParser input)
{
_assemId = input.ReadInt32();
_assemblyString = input.ReadString();
}
}
}

View File

@@ -0,0 +1,38 @@
// 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.Reflection;
namespace System.Runtime.Serialization.Formatters.Binary
{
internal sealed class BinaryAssemblyInfo
{
internal string _assemblyString;
private Assembly _assembly;
internal BinaryAssemblyInfo(string assemblyString)
{
_assemblyString = assemblyString;
}
internal BinaryAssemblyInfo(string assemblyString, Assembly assembly) : this(assemblyString)
{
_assembly = assembly;
}
internal Assembly GetAssembly()
{
if (_assembly == null)
{
_assembly = FormatterServices.LoadAssemblyFromStringNoThrow(_assemblyString);
if (_assembly == null)
{
throw new SerializationException(SR.Format(SR.Serialization_AssemblyNotFound, _assemblyString));
}
}
return _assembly;
}
}
}

View File

@@ -0,0 +1,29 @@
// 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.
namespace System.Runtime.Serialization.Formatters.Binary
{
internal sealed class BinaryCrossAppDomainAssembly : IStreamable
{
internal int _assemId;
internal int _assemblyIndex;
internal BinaryCrossAppDomainAssembly()
{
}
public void Write(BinaryFormatterWriter output)
{
output.WriteByte((byte)BinaryHeaderEnum.CrossAppDomainAssembly);
output.WriteInt32(_assemId);
output.WriteInt32(_assemblyIndex);
}
public void Read(BinaryParser input)
{
_assemId = input.ReadInt32();
_assemblyIndex = input.ReadInt32();
}
}
}

View File

@@ -0,0 +1,22 @@
// 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.
namespace System.Runtime.Serialization.Formatters.Binary
{
internal sealed class BinaryCrossAppDomainMap : IStreamable
{
internal int _crossAppDomainArrayIndex;
public void Write(BinaryFormatterWriter output)
{
output.WriteByte((byte)BinaryHeaderEnum.CrossAppDomainMap);
output.WriteInt32(_crossAppDomainArrayIndex);
}
public void Read(BinaryParser input)
{
_crossAppDomainArrayIndex = input.ReadInt32();
}
}
}

View File

@@ -0,0 +1,29 @@
// 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.
namespace System.Runtime.Serialization.Formatters.Binary
{
internal sealed class BinaryCrossAppDomainString : IStreamable
{
internal int _objectId;
internal int _value;
internal BinaryCrossAppDomainString()
{
}
public void Write(BinaryFormatterWriter output)
{
output.WriteByte((byte)BinaryHeaderEnum.CrossAppDomainString);
output.WriteInt32(_objectId);
output.WriteInt32(_value);
}
public void Read(BinaryParser input)
{
_objectId = input.ReadInt32();
_value = input.ReadInt32();
}
}
}

View File

@@ -0,0 +1,188 @@
// 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.
namespace System.Runtime.Serialization.Formatters.Binary
{
// BinaryHeaderEnum is the first byte on binary records (except for primitive types which do not have a header)
[Serializable]
internal enum BinaryHeaderEnum
{
SerializedStreamHeader = 0,
Object = 1,
ObjectWithMap = 2,
ObjectWithMapAssemId = 3,
ObjectWithMapTyped = 4,
ObjectWithMapTypedAssemId = 5,
ObjectString = 6,
Array = 7,
MemberPrimitiveTyped = 8,
MemberReference = 9,
ObjectNull = 10,
MessageEnd = 11,
Assembly = 12,
ObjectNullMultiple256 = 13,
ObjectNullMultiple = 14,
ArraySinglePrimitive = 15,
ArraySingleObject = 16,
ArraySingleString = 17,
CrossAppDomainMap = 18,
CrossAppDomainString = 19,
CrossAppDomainAssembly = 20,
MethodCall = 21,
MethodReturn = 22,
}
// BinaryTypeEnum is used specify the type on the wire. Additional information is transmitted with Primitive and Object types
[Serializable]
internal enum BinaryTypeEnum
{
Primitive = 0,
String = 1,
Object = 2,
ObjectUrt = 3,
ObjectUser = 4,
ObjectArray = 5,
StringArray = 6,
PrimitiveArray = 7,
}
[Serializable]
internal enum BinaryArrayTypeEnum
{
Single = 0,
Jagged = 1,
Rectangular = 2,
SingleOffset = 3,
JaggedOffset = 4,
RectangularOffset = 5,
}
// Enums are for internal use by the XML and Binary Serializers
// Formatter Enums
[Serializable]
internal enum InternalSerializerTypeE
{
Soap = 1,
Binary = 2,
}
// ParseRecord Enums
[Serializable]
internal enum InternalParseTypeE
{
Empty = 0,
SerializedStreamHeader = 1,
Object = 2,
Member = 3,
ObjectEnd = 4,
MemberEnd = 5,
Headers = 6,
HeadersEnd = 7,
SerializedStreamHeaderEnd = 8,
Envelope = 9,
EnvelopeEnd = 10,
Body = 11,
BodyEnd = 12,
}
[Serializable]
internal enum InternalObjectTypeE
{
Empty = 0,
Object = 1,
Array = 2,
}
[Serializable]
internal enum InternalObjectPositionE
{
Empty = 0,
Top = 1,
Child = 2,
Headers = 3,
}
[Serializable]
internal enum InternalArrayTypeE
{
Empty = 0,
Single = 1,
Jagged = 2,
Rectangular = 3,
Base64 = 4,
}
[Serializable]
internal enum InternalMemberTypeE
{
Empty = 0,
Header = 1,
Field = 2,
Item = 3,
}
[Serializable]
internal enum InternalMemberValueE
{
Empty = 0,
InlineValue = 1,
Nested = 2,
Reference = 3,
Null = 4,
}
// Data Type Enums
[Serializable]
internal enum InternalPrimitiveTypeE
{
Invalid = 0,
Boolean = 1,
Byte = 2,
Char = 3,
Currency = 4,
Decimal = 5,
Double = 6,
Int16 = 7,
Int32 = 8,
Int64 = 9,
SByte = 10,
Single = 11,
TimeSpan = 12,
DateTime = 13,
UInt16 = 14,
UInt32 = 15,
UInt64 = 16,
// Used in only for MethodCall or MethodReturn header
Null = 17,
String = 18,
}
// ValueType Fixup Enum
[Serializable]
internal enum ValueFixupEnum
{
Empty = 0,
Array = 1,
Header = 2,
Member = 3,
}
// name space
[Serializable]
internal enum InternalNameSpaceE
{
None = 0,
Soap = 1,
XdrPrimitive = 2,
XdrString = 3,
UrtSystem = 4,
UrtUser = 5,
UserNameSpace = 6,
MemberName = 7,
Interop = 8,
CallElement = 9
}
}

Some files were not shown because too many files have changed in this diff Show More