-
Notifications
You must be signed in to change notification settings - Fork 4.5k
/
System.Runtime.Serialization.Formatters.cs
208 lines (207 loc) · 16.9 KB
/
System.Runtime.Serialization.Formatters.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// ------------------------------------------------------------------------------
// Changes to this file must follow the https://aka.ms/api-review process.
// ------------------------------------------------------------------------------
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; }
[System.ObsoleteAttribute("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId = "SYSLIB0011", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
[System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute("BinaryFormatter serialization uses dynamic code generation, the type of objects being processed cannot be statically discovered.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the type of objects being processed cannot be statically discovered.")]
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; }
[System.ObsoleteAttribute("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId = "SYSLIB0011", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the type of objects being processed cannot be statically discovered.")]
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.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] System.Type type) { throw null; }
public static System.Reflection.MemberInfo[] GetSerializableMembers([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type type) { throw null; }
public static System.Reflection.MemberInfo[] GetSerializableMembers([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type type, System.Runtime.Serialization.StreamingContext context) { throw null; }
public static System.Runtime.Serialization.ISerializationSurrogate GetSurrogateForCyclicalReference(System.Runtime.Serialization.ISerializationSurrogate innerSurrogate) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types might be removed")]
public static System.Type? GetTypeFromAssembly(System.Reflection.Assembly assem, string name) { throw null; }
public static object GetUninitializedObject([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] 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; }
[System.ObsoleteAttribute("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId = "SYSLIB0011", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
[System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute("BinaryFormatter serialization uses dynamic code generation, the type of objects being processed cannot be statically discovered.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the type of objects being processed cannot be statically discovered.")]
object Deserialize(System.IO.Stream serializationStream);
[System.ObsoleteAttribute("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId = "SYSLIB0011", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the type of objects being processed cannot be statically discovered.")]
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) { }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the type of objects being managed cannot be statically discovered.")]
public virtual void DoFixups() { }
public virtual object? GetObject(long objectID) { throw null; }
public virtual void RaiseDeserializationEvent() { }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the type of objects being managed cannot be statically discovered.")]
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) { }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the type of objects being managed cannot be statically discovered.")]
public virtual void RegisterObject(object obj, long objectID) { }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the type of objects being managed cannot be statically discovered.")]
public void RegisterObject(object obj, long objectID, System.Runtime.Serialization.SerializationInfo info) { }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the type of objects being managed cannot be statically discovered.")]
public void RegisterObject(object obj, long objectID, System.Runtime.Serialization.SerializationInfo? info, long idOfContainingObj, System.Reflection.MemberInfo? member) { }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("ObjectManager is not trim compatible because the type of objects being managed cannot be statically discovered.")]
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() { }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("SerializationObjectManager is not trim compatible because the type of objects being managed cannot be statically discovered.")]
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) { }
}
}
namespace System.Runtime.Serialization.Formatters
{
public enum FormatterAssemblyStyle
{
Simple = 0,
Full = 1,
}
public enum FormatterTypeStyle
{
TypesWhenNeeded = 0,
TypesAlways = 1,
XsdString = 2,
}
public partial interface IFieldInfo
{
string[]? FieldNames { get; set; }
System.Type[]? FieldTypes { get; set; }
}
public enum TypeFilterLevel
{
Low = 2,
Full = 3,
}
}
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 { } }
[System.ObsoleteAttribute("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId = "SYSLIB0011", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
[System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute("BinaryFormatter serialization uses dynamic code generation, the type of objects being processed cannot be statically discovered.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the type of objects being processed cannot be statically discovered.")]
public object Deserialize(System.IO.Stream serializationStream) { throw null; }
[System.ObsoleteAttribute("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId = "SYSLIB0011", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("BinaryFormatter serialization is not trim compatible because the type of objects being processed cannot be statically discovered.")]
public void Serialize(System.IO.Stream serializationStream, object graph) { }
}
}