8 types derived from SerializationRecord
System.Formats.Nrbf (8)
System\Formats\Nrbf\ArrayRecord.cs (1)
16
public abstract class ArrayRecord :
SerializationRecord
System\Formats\Nrbf\BinaryLibraryRecord.cs (1)
17
internal sealed class BinaryLibraryRecord :
SerializationRecord
System\Formats\Nrbf\ClassRecord.cs (1)
13
public abstract class ClassRecord :
SerializationRecord
System\Formats\Nrbf\MemberReferenceRecord.cs (1)
16
internal sealed class MemberReferenceRecord :
SerializationRecord
System\Formats\Nrbf\MessageEndRecord.cs (1)
15
internal sealed class MessageEndRecord :
SerializationRecord
System\Formats\Nrbf\NullsRecord.cs (1)
9
internal abstract class NullsRecord :
SerializationRecord
System\Formats\Nrbf\PrimitiveTypeRecord.cs (1)
23
public abstract class PrimitiveTypeRecord :
SerializationRecord
System\Formats\Nrbf\SerializedStreamHeaderRecord.cs (1)
17
internal sealed class SerializedStreamHeaderRecord :
SerializationRecord
215 references to SerializationRecord
BinaryFormatTests (10)
FormatTests\FormattedObject\BinaryFormatWriterTests.cs (2)
103
SerializationRecord
rootRecord = NrbfDecoder.Decode(stream);
135
SerializationRecord
rootRecord = NrbfDecoder.Decode(stream);
FormatTests\FormattedObject\HashTableTests.cs (3)
71
SerializationRecord
rootRecord = NrbfDecoder.Decode(Serialize(hashtable));
129
SerializationRecord
rootRecord = NrbfDecoder.Decode(Serialize(hashtable));
147
SerializationRecord
rootRecord = NrbfDecoder.Decode(stream);
FormatTests\FormattedObject\ListTests.cs (1)
83
SerializationRecord
rootRecord = NrbfDecoder.Decode(Serialize(list));
FormatTests\FormattedObject\PrimitiveTypeTests.cs (1)
112
SerializationRecord
rootRecord = NrbfDecoder.Decode(Serialize(value));
SerializationRecordExtensionsTests.cs (3)
28
SerializationRecord
rootRecord = NrbfDecoder.Decode(stream);
66
SerializationRecord
rootRecord = NrbfDecoder.Decode(stream);
91
SerializationRecord
rootRecord = NrbfDecoder.Decode(stream);
PresentationCore (29)
System\Windows\Nrbf\SerializationRecordExtensions.cs (29)
14
private delegate bool TryGetDelegate(
SerializationRecord
record, [NotNullWhen(true)] out object? value);
16
private static bool TryGet(TryGetDelegate get,
SerializationRecord
record, [NotNullWhen(true)] out object? value)
34
public static bool TryGetPointF(this
SerializationRecord
record, [NotNullWhen(true)] out object? value)
38
static bool Get(
SerializationRecord
record, [NotNullWhen(true)] out object? value)
59
public static bool TryGetRectangleF(this
SerializationRecord
record, [NotNullWhen(true)] out object? value)
63
static bool Get(
SerializationRecord
record, [NotNullWhen(true)] out object? value)
91
public static bool TryGetPrimitiveType(this
SerializationRecord
record, [NotNullWhen(true)] out object? value)
95
static bool Get(
SerializationRecord
record, [NotNullWhen(true)] out object? value)
116
public static bool TryGetPrimitiveList(this
SerializationRecord
record, [NotNullWhen(true)] out object? list)
120
static bool Get(
SerializationRecord
record, [NotNullWhen(true)] out object? list)
166
public static bool TryGetPrimitiveArrayList(this
SerializationRecord
record, [NotNullWhen(true)] out object? value)
170
static bool Get(
SerializationRecord
record, [NotNullWhen(true)] out object? value)
179
|| classInfo.GetRawValue("_items") is not SZArrayRecord<
SerializationRecord
> arrayRecord
186
SerializationRecord
?[] array = arrayRecord.GetArray();
189
SerializationRecord
? elementRecord = array[i];
213
public static bool TryGetPrimitiveArray(this
SerializationRecord
record, [NotNullWhen(true)] out object? value)
217
static bool Get(
SerializationRecord
record, [NotNullWhen(true)] out object? value)
253
public static bool TryGetPrimitiveHashtable(this
SerializationRecord
record, [NotNullWhen(true)] out object? hashtable)
257
static bool Get(
SerializationRecord
record, [NotNullWhen(true)] out object? hashtable)
268
|| classInfo.GetSerializationRecord("Keys") is not SZArrayRecord<
SerializationRecord
?> keysRecord
269
|| classInfo.GetSerializationRecord("Values") is not SZArrayRecord<
SerializationRecord
?> valuesRecord
276
SerializationRecord
?[] keys = keysRecord.GetArray();
277
SerializationRecord
?[] values = valuesRecord.GetArray();
280
SerializationRecord
? key = keys[i];
281
SerializationRecord
? value = values[i];
312
this
SerializationRecord
record,
317
static bool Get(
SerializationRecord
record, [NotNullWhen(true)] out object? exception)
336
this
SerializationRecord
record,
347
private static bool IsPrimitiveArrayRecord(
SerializationRecord
serializationRecord)
PresentationCore.Tests (9)
BinaryFormat\BinaryFormatWriterTests.cs (1)
73
SerializationRecord
format = NrbfDecoder.Decode(stream);
BinaryFormat\HashTableTests.cs (3)
70
SerializationRecord
format = hashtable.SerializeAndParse();
129
SerializationRecord
format = hashtable.SerializeAndParse();
147
SerializationRecord
format = NrbfDecoder.Decode(stream);
BinaryFormat\ListTests.cs (1)
101
SerializationRecord
format = list.SerializeAndParse();
BinaryFormat\SystemDrawingTests.cs (2)
15
SerializationRecord
record = input.SerializeAndParse();
27
SerializationRecord
record = input.SerializeAndParse();
TestUtilities\BinaryFormatTestExtensions.cs (2)
14
/// Serializes the object using the <see cref="BinaryFormatter"/> and reads it into a <see cref="
SerializationRecord
"/>.
16
public static
SerializationRecord
SerializeAndParse(this object source) => NrbfDecoder.Decode(source.Serialize());
System.Formats.Nrbf (73)
System\Formats\Nrbf\ArrayRecord.cs (4)
94
internal sealed override void HandleNextRecord(
SerializationRecord
nextRecord, NextInfo info)
119
internal static void Populate(List<
SerializationRecord
> source, Array destination, int[] lengths, AllowedRecordTypes allowedRecordTypes, bool allowNulls)
124
foreach (
SerializationRecord
record in source)
165
private static object? GetActualValue(
SerializationRecord
record, AllowedRecordTypes allowedRecordTypes, out int repeatCount)
System\Formats\Nrbf\ArraySingleObjectRecord.cs (9)
18
internal sealed class ArraySingleObjectRecord : SZArrayRecord<
SerializationRecord
>
27
private List<
SerializationRecord
> Records { get; }
30
public override
SerializationRecord
?[] GetArray(bool allowNulls = true)
31
=> (
SerializationRecord
?[])(allowNulls ? _arrayNullsAllowed ??= ToArray(true) : _arrayNullsNotAllowed ??= ToArray(false));
33
private
SerializationRecord
?[] ToArray(bool allowNulls)
35
SerializationRecord
?[] values = new
SerializationRecord
?[Length];
40
SerializationRecord
record = Records[recordIndex];
83
private protected override void AddValue(object value) => Records.Add((
SerializationRecord
)value);
System\Formats\Nrbf\ArraySingleStringRecord.cs (3)
27
private List<
SerializationRecord
> Records { get; }
41
private protected override void AddValue(object value) => Records.Add((
SerializationRecord
)value);
54
SerializationRecord
record = Records[recordIndex];
System\Formats\Nrbf\ClassRecord.cs (6)
109
/// Retrieves the <see cref="
SerializationRecord
" /> of the provided <paramref name="memberName"/>.
116
/// <exception cref="InvalidOperationException">The specified member is not a <see cref="
SerializationRecord
"/>, but just a raw primitive value.</exception>
117
public
SerializationRecord
? GetSerializationRecord(string memberName)
122
SerializationRecord
serializationRecord => serializationRecord,
131
if (value is
SerializationRecord
record)
145
internal override void HandleNextRecord(
SerializationRecord
nextRecord, NextInfo info)
System\Formats\Nrbf\ClassWithIdRecord.cs (3)
31
internal static
SerializationRecord
Decode(
38
SerializationRecord
metadataRecord = recordMap.GetRecord(metadataId);
80
SerializationRecord
Create<T>(T value) where T : unmanaged
System\Formats\Nrbf\JaggedArrayRecord.cs (2)
24
private readonly List<
SerializationRecord
> _records;
61
private protected override void AddValue(object value) => _records.Add((
SerializationRecord
)value);
System\Formats\Nrbf\MemberReferenceRecord.cs (1)
41
internal
SerializationRecord
GetReferencedRecord() => RecordMap.GetRecord(Reference);
System\Formats\Nrbf\NextInfo.cs (2)
12
internal NextInfo(AllowedRecordTypes allowed,
SerializationRecord
parent,
23
internal
SerializationRecord
Parent { get; }
System\Formats\Nrbf\NrbfDecoder.cs (13)
100
/// <returns>A <see cref="
SerializationRecord
"/> that represents the root object.
116
public static
SerializationRecord
Decode(Stream payload, PayloadOptions? options = default, bool leaveOpen = false)
130
public static
SerializationRecord
Decode(Stream payload, out IReadOnlyDictionary<SerializationRecordId,
SerializationRecord
> recordMap, PayloadOptions? options = default, bool leaveOpen = false)
160
private static
SerializationRecord
Decode(BinaryReader reader, PayloadOptions options, out IReadOnlyDictionary<SerializationRecordId,
SerializationRecord
> readOnlyRecordMap)
172
SerializationRecord
nextRecord;
217
private static
SerializationRecord
DecodeNext(BinaryReader reader, RecordMap recordMap,
222
SerializationRecord
record = recordType switch
248
private static
SerializationRecord
DecodeMemberPrimitiveTypedRecord(BinaryReader reader)
394
return new RectangularArrayRecord(typeof(
SerializationRecord
), arrayInfo, memberTypeInfo, lengths);
402
: new RectangularArrayRecord(typeof(
SerializationRecord
), arrayInfo, memberTypeInfo, lengths);
476
private static void PushFirstNestedRecordInfo(
SerializationRecord
record, Stack<NextInfo> readStack)
System\Formats\Nrbf\RecordMap.cs (12)
12
internal sealed class RecordMap : IReadOnlyDictionary<SerializationRecordId,
SerializationRecord
>
14
private readonly Dictionary<SerializationRecordId,
SerializationRecord
> _map = new();
18
public IEnumerable<
SerializationRecord
> Values => _map.Values;
22
public
SerializationRecord
this[SerializationRecordId objectId] => _map[objectId];
26
public bool TryGetValue(SerializationRecordId key, [MaybeNullWhen(false)] out
SerializationRecord
value) => _map.TryGetValue(key, out value);
28
public IEnumerator<KeyValuePair<SerializationRecordId,
SerializationRecord
>> GetEnumerator() => _map.GetEnumerator();
32
internal void Add(
SerializationRecord
record)
64
internal
SerializationRecord
GetRootRecord(SerializedStreamHeaderRecord header) => GetRecord(header.RootId);
66
internal
SerializationRecord
GetRecord(SerializationRecordId recordId)
67
=> _map.TryGetValue(recordId, out
SerializationRecord
? record)
71
internal T GetRecord<T>(SerializationRecordId recordId) where T :
SerializationRecord
72
=> _map.TryGetValue(recordId, out
SerializationRecord
? record) && record is T casted
System\Formats\Nrbf\RectangularArrayRecord.cs (4)
20
private readonly List<
SerializationRecord
> _records;
30
_records = new List<
SerializationRecord
>(Math.Min(4, arrayInfo.GetSZArrayLength()));
33
Debug.Assert(elementType == typeof(string) || elementType == typeof(
SerializationRecord
));
66
private protected override void AddValue(object value) => _records.Add((
SerializationRecord
)value);
System\Formats\Nrbf\SerializationRecord.cs (1)
162
internal virtual void HandleNextRecord(
SerializationRecord
nextRecord, NextInfo info)
System\Formats\Nrbf\SerializationRecordId.cs (1)
17
/// The ID of <see cref="
SerializationRecord
" />.
System\Formats\Nrbf\SystemClassWithMembersAndTypesRecord.cs (2)
25
internal static
SerializationRecord
Decode(BinaryReader reader, RecordMap recordMap, PayloadOptions options)
92
SerializationRecord
Create<T>(T value) where T : unmanaged
System\Formats\Nrbf\SZArrayOfRecords.cs (10)
15
internal sealed class SZArrayOfRecords : SZArrayRecord<
SerializationRecord
>
28
internal List<
SerializationRecord
> Records { get; }
36
public override
SerializationRecord
?[] GetArray(bool allowNulls = true)
37
=> (
SerializationRecord
?[])(allowNulls ? _arrayNullsAllowed ??= ToArray(true) : _arrayNullsNotAllowed ??= ToArray(false));
39
private
SerializationRecord
?[] ToArray(bool allowNulls)
41
SerializationRecord
?[] result = new
SerializationRecord
?[Length];
44
foreach (
SerializationRecord
record in Records)
46
SerializationRecord
actual = record is MemberReferenceRecord referenceRecord
77
private protected override void AddValue(object value) => Records.Add((
SerializationRecord
)value);
System.Private.Windows.Core (57)
System\Private\Windows\Core\BinaryFormat\Deserializer\ArrayRecordDeserializer.cs (1)
100
internal static Array GetArraySinglePrimitive(
SerializationRecord
record) => record switch
System\Private\Windows\Core\BinaryFormat\Deserializer\Deserializer.cs (4)
52
private readonly IReadOnlyDictionary<SerializationRecordId,
SerializationRecord
> _recordMap;
101
IReadOnlyDictionary<SerializationRecordId,
SerializationRecord
> recordMap,
121
IReadOnlyDictionary<SerializationRecordId,
SerializationRecord
> recordMap,
220
SerializationRecord
record = _recordMap[id];
System\Private\Windows\Core\BinaryFormat\Deserializer\ObjectRecordDeserializer.cs (4)
19
internal
SerializationRecord
ObjectRecord { get; }
26
private protected ObjectRecordDeserializer(
SerializationRecord
objectRecord, IDeserializer deserializer)
49
else if (memberValue is not
SerializationRecord
serializationRecord) // a primitive value
97
internal static ObjectRecordDeserializer Create(
SerializationRecord
record, IDeserializer deserializer) => record switch
System\Private\Windows\Core\Nrbf\SerializationRecordExtensions.cs (48)
28
internal static
SerializationRecord
Decode(this Stream stream)
45
internal static
SerializationRecord
Decode(this Stream stream, out IReadOnlyDictionary<SerializationRecordId,
SerializationRecord
> recordMap)
63
/// Deserializes the <see cref="
SerializationRecord
"/> to an object.
67
this
SerializationRecord
rootRecord,
68
IReadOnlyDictionary<SerializationRecordId,
SerializationRecord
> recordMap,
87
internal delegate bool TryGetDelegate(
SerializationRecord
record, [NotNullWhen(true)] out object? value);
89
internal static bool TryGet(TryGetDelegate get,
SerializationRecord
record, [NotNullWhen(true)] out object? value)
107
public static bool TryGetPoint(this
SerializationRecord
record, [NotNullWhen(true)] out object? value)
111
static bool Get(
SerializationRecord
record, [NotNullWhen(true)] out object? value)
132
public static bool TryGetSize(this
SerializationRecord
record, [NotNullWhen(true)] out object? value)
136
static bool Get(
SerializationRecord
record, [NotNullWhen(true)] out object? value)
157
public static bool TryGetRectangle(this
SerializationRecord
record, [NotNullWhen(true)] out object? value)
161
static bool Get(
SerializationRecord
record, [NotNullWhen(true)] out object? value)
188
public static bool TryGetPointF(this
SerializationRecord
record, [NotNullWhen(true)] out object? value)
192
static bool Get(
SerializationRecord
record, [NotNullWhen(true)] out object? value)
213
public static bool TryGetSizeF(this
SerializationRecord
record, [NotNullWhen(true)] out object? value)
217
static bool Get(
SerializationRecord
record, [NotNullWhen(true)] out object? value)
238
public static bool TryGetRectangleF(this
SerializationRecord
record, [NotNullWhen(true)] out object? value)
242
static bool Get(
SerializationRecord
record, [NotNullWhen(true)] out object? value)
269
public static bool TryGetColor(this
SerializationRecord
record, [NotNullWhen(true)] out object? value)
273
static bool Get(
SerializationRecord
record, [NotNullWhen(true)] out object? value)
308
public static bool TryGetPrimitiveType(this
SerializationRecord
record, [NotNullWhen(true)] out object? value)
312
static bool Get(
SerializationRecord
record, [NotNullWhen(true)] out object? value)
330
internal static object GetMemberPrimitiveTypedValue(this
SerializationRecord
record)
339
public static bool TryGetPrimitiveList(this
SerializationRecord
record, [NotNullWhen(true)] out object? list)
343
static bool Get(
SerializationRecord
record, [NotNullWhen(true)] out object? list)
389
public static bool TryGetPrimitiveArrayList(this
SerializationRecord
record, [NotNullWhen(true)] out object? value)
393
static bool Get(
SerializationRecord
record, [NotNullWhen(true)] out object? value)
402
|| classInfo.GetRawValue("_items") is not SZArrayRecord<
SerializationRecord
> arrayRecord
409
SerializationRecord
?[] array = arrayRecord.GetArray();
412
SerializationRecord
? elementRecord = array[i];
436
public static bool TryGetPrimitiveArray(this
SerializationRecord
record, [NotNullWhen(true)] out object? value)
440
static bool Get(
SerializationRecord
record, [NotNullWhen(true)] out object? value)
476
public static bool TryGetPrimitiveHashtable(this
SerializationRecord
record, [NotNullWhen(true)] out Hashtable? hashtable)
486
public static bool TryGetPrimitiveHashtable(this
SerializationRecord
record, [NotNullWhen(true)] out object? hashtable)
490
static bool Get(
SerializationRecord
record, [NotNullWhen(true)] out object? hashtable)
501
|| classInfo.GetSerializationRecord("Keys") is not SZArrayRecord<
SerializationRecord
?> keysRecord
502
|| classInfo.GetSerializationRecord("Values") is not SZArrayRecord<
SerializationRecord
?> valuesRecord
509
SerializationRecord
?[] keys = keysRecord.GetArray();
510
SerializationRecord
?[] values = valuesRecord.GetArray();
513
SerializationRecord
? key = keys[i];
514
SerializationRecord
? value = values[i];
545
this
SerializationRecord
record,
550
static bool Get(
SerializationRecord
record, [NotNullWhen(true)] out object? exception)
569
this
SerializationRecord
record,
585
this
SerializationRecord
record,
593
private static bool IsPrimitiveArrayRecord(
SerializationRecord
serializationRecord) =>
System.Resources.Extensions (14)
System\Resources\Extensions\BinaryFormat\BinaryFormattedObject.cs (3)
86
public
SerializationRecord
RootRecord { get; }
92
public
SerializationRecord
this[SerializationRecordId id] => RecordMap[id];
94
public IReadOnlyDictionary<SerializationRecordId,
SerializationRecord
> RecordMap { get; }
System\Resources\Extensions\BinaryFormat\BinaryFormattedObject.IParseState.cs (1)
18
IReadOnlyDictionary<SerializationRecordId,
SerializationRecord
> RecordMap { get; }
System\Resources\Extensions\BinaryFormat\BinaryFormattedObject.ParseState.cs (1)
26
public IReadOnlyDictionary<SerializationRecordId,
SerializationRecord
> RecordMap => _format.RecordMap;
System\Resources\Extensions\BinaryFormat\Deserializer\ArrayRecordDeserializer.cs (1)
103
internal static Array GetArraySinglePrimitive(
SerializationRecord
record) => record switch
System\Resources\Extensions\BinaryFormat\Deserializer\Deserializer.cs (4)
54
private readonly IReadOnlyDictionary<SerializationRecordId,
SerializationRecord
> _recordMap;
103
IReadOnlyDictionary<SerializationRecordId,
SerializationRecord
> recordMap,
124
IReadOnlyDictionary<SerializationRecordId,
SerializationRecord
> recordMap,
224
SerializationRecord
record = _recordMap[id];
System\Resources\Extensions\BinaryFormat\Deserializer\ObjectRecordDeserializer.cs (4)
18
internal
SerializationRecord
ObjectRecord { get; }
25
private protected ObjectRecordDeserializer(
SerializationRecord
objectRecord, IDeserializer deserializer)
48
else if (memberValue is not
SerializationRecord
serializationRecord) // a primitive value
96
internal static ObjectRecordDeserializer Create(
SerializationRecord
record, IDeserializer deserializer) => record switch
System.Windows.Forms (14)
System\Resources\ResXDataNode.cs (1)
432
SerializationRecord
rootRecord = stream.Decode();
System\Windows\Forms\ActiveX\AxHost.PropertyBagStream.cs (1)
28
SerializationRecord
rootRecord = stream.Decode();
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (1)
1133
SerializationRecord
rootRecord = stream.Decode();
System\Windows\Forms\ActiveX\Control.ActiveXImpl.PropertyBagStream.cs (1)
32
SerializationRecord
rootRecord = stream.Decode();
System\Windows\Forms\Nrbf\WinFormsSerializationRecordExtensions.cs (6)
20
this
SerializationRecord
record,
25
static bool Get(
SerializationRecord
record, [NotNullWhen(true)] out object? imageListStreamer)
45
public static bool TryGetBitmap(this
SerializationRecord
record, out object? bitmap)
69
public static bool TryGetObjectFromJson<T>(this
SerializationRecord
record, ITypeResolver resolver, out object? @object)
110
public static bool TryGetResXObject(this
SerializationRecord
record, [NotNullWhen(true)] out object? value) =>
115
public static bool TryGetCommonObject(this
SerializationRecord
record, [NotNullWhen(true)] out object? value) =>
System\Windows\Forms\OLE\Clipboard.cs (1)
451
/// <see cref="Bitmap"/>s are re-hydrated from a <see cref="
SerializationRecord
"/> by reading a byte array.
System\Windows\Forms\OLE\DataObject.Composition.BinaryFormatUtilities.cs (3)
73
SerializationRecord
? record;
75
IReadOnlyDictionary<SerializationRecordId,
SerializationRecord
> recordMap;
165
SerializationRecord
? record;
System.Windows.Forms.Primitives.TestUtilities (2)
System\Windows\Forms\BinaryFormat\BinaryFormatTestExtensions.cs (2)
14
/// Serializes the object using the <see cref="BinaryFormatter"/> and reads it into a <see cref="
SerializationRecord
"/>.
16
public static
SerializationRecord
SerializeAndDecode(this object source)
System.Windows.Forms.Tests (7)
System\Windows\Forms\BinaryFormat\WinFormsBinaryFormattedObjectTests.cs (6)
27
SerializationRecord
format = testData.SerializeAndDecode();
46
SerializationRecord
binary = NrbfDecoder.Decode(stream);
114
SerializationRecord
rootRecord = bitmap.SerializeAndDecode();
134
SerializationRecord
rootRecord = NrbfDecoder.Decode(stream);
169
SerializationRecord
rootRecord = stream.SerializeAndDecode();
195
SerializationRecord
rootRecord = NrbfDecoder.Decode(memoryStream);
System\Windows\Forms\ClipboardTests.cs (1)
1048
SerializationRecord
record = NrbfDecoder.Decode(stream);