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