168 references to PrimitiveType
PresentationCore (3)
System\Windows\Nrbf\SerializationRecordExtensions.cs (3)
114
/// Trys to get this object as a <see cref="List{T}"/> of <see cref="
PrimitiveType
"/>.
164
/// Tries to get this object as a <see cref="ArrayList"/> of <see cref="
PrimitiveType
"/> values.
251
/// Trys to get this object as a binary recordted <see cref="Hashtable"/> of <see cref="
PrimitiveType
"/> keys and values.
System.Formats.Nrbf (161)
System\Formats\Nrbf\ArrayRecord.cs (1)
117
internal abstract (AllowedRecordTypes allowed,
PrimitiveType
primitiveType) GetAllowedRecordType();
System\Formats\Nrbf\ArrayRectangularPrimitiveRecord.cs (1)
38
internal override (AllowedRecordTypes allowed,
PrimitiveType
primitiveType) GetAllowedRecordType() => throw new InvalidOperationException();
System\Formats\Nrbf\ArraySingleObjectRecord.cs (1)
75
internal override (AllowedRecordTypes allowed,
PrimitiveType
primitiveType) GetAllowedRecordType()
System\Formats\Nrbf\ArraySinglePrimitiveRecord.cs (1)
44
internal override (AllowedRecordTypes allowed,
PrimitiveType
primitiveType) GetAllowedRecordType() => throw new InvalidOperationException();
System\Formats\Nrbf\ArraySingleStringRecord.cs (1)
32
internal override (AllowedRecordTypes allowed,
PrimitiveType
primitiveType) GetAllowedRecordType()
System\Formats\Nrbf\BinaryType.cs (1)
15
/// The type is defined by <see cref="
PrimitiveType
"/> and it is not a string.
System\Formats\Nrbf\ClassRecord.cs (2)
143
internal abstract (AllowedRecordTypes allowed,
PrimitiveType
primitiveType) GetNextAllowedRecordType();
160
(AllowedRecordTypes allowed,
PrimitiveType
primitiveType) = GetNextAllowedRecordType();
System\Formats\Nrbf\ClassWithIdRecord.cs (1)
84
internal override (AllowedRecordTypes allowed,
PrimitiveType
primitiveType) GetNextAllowedRecordType()
System\Formats\Nrbf\ClassWithMembersAndTypesRecord.cs (1)
36
internal override (AllowedRecordTypes allowed,
PrimitiveType
primitiveType) GetNextAllowedRecordType()
System\Formats\Nrbf\JaggedArrayRecord.cs (1)
63
internal override (AllowedRecordTypes allowed,
PrimitiveType
primitiveType) GetAllowedRecordType()
System\Formats\Nrbf\MemberTypeInfo.cs (4)
70
internal (AllowedRecordTypes allowed,
PrimitiveType
primitiveType) GetNextAllowedRecordType(int currentValuesCount)
99
BinaryType.Primitive => (default, (
PrimitiveType
)additionalInfo!),
119
BinaryType.Primitive => TypeNameHelpers.GetPrimitiveTypeName((
PrimitiveType
)additionalInfo!),
120
BinaryType.PrimitiveArray => TypeNameHelpers.GetPrimitiveSZArrayTypeName((
PrimitiveType
)additionalInfo!),
System\Formats\Nrbf\NextInfo.cs (3)
13
Stack<NextInfo> stack,
PrimitiveType
primitiveType = default)
27
internal
PrimitiveType
PrimitiveType { get; }
29
internal NextInfo With(AllowedRecordTypes allowed,
PrimitiveType
primitiveType)
System\Formats\Nrbf\NrbfDecoder.cs (53)
250
PrimitiveType
primitiveType = reader.ReadPrimitiveType();
254
PrimitiveType
.Boolean => new MemberPrimitiveTypedRecord<bool>(reader.ReadBoolean()),
255
PrimitiveType
.Byte => new MemberPrimitiveTypedRecord<byte>(reader.ReadByte()),
256
PrimitiveType
.SByte => new MemberPrimitiveTypedRecord<sbyte>(reader.ReadSByte()),
257
PrimitiveType
.Char => new MemberPrimitiveTypedRecord<char>(reader.ParseChar()),
258
PrimitiveType
.Int16 => new MemberPrimitiveTypedRecord<short>(reader.ReadInt16()),
259
PrimitiveType
.UInt16 => new MemberPrimitiveTypedRecord<ushort>(reader.ReadUInt16()),
260
PrimitiveType
.Int32 => new MemberPrimitiveTypedRecord<int>(reader.ReadInt32()),
261
PrimitiveType
.UInt32 => new MemberPrimitiveTypedRecord<uint>(reader.ReadUInt32()),
262
PrimitiveType
.Int64 => new MemberPrimitiveTypedRecord<long>(reader.ReadInt64()),
263
PrimitiveType
.UInt64 => new MemberPrimitiveTypedRecord<ulong>(reader.ReadUInt64()),
264
PrimitiveType
.Single => new MemberPrimitiveTypedRecord<float>(reader.ReadSingle()),
265
PrimitiveType
.Double => new MemberPrimitiveTypedRecord<double>(reader.ReadDouble()),
266
PrimitiveType
.Decimal => new MemberPrimitiveTypedRecord<decimal>(reader.ParseDecimal()),
267
PrimitiveType
.DateTime => new MemberPrimitiveTypedRecord<DateTime>(Utils.BinaryReaderExtensions.CreateDateTimeFromData(reader.ReadUInt64())),
268
PrimitiveType
.TimeSpan => new MemberPrimitiveTypedRecord<TimeSpan>(new TimeSpan(reader.ReadInt64())),
276
PrimitiveType
primitiveType = reader.ReadPrimitiveType();
281
private static ArrayRecord DecodeArraySinglePrimitiveRecord(BinaryReader reader, ArrayInfo info,
PrimitiveType
primitiveType)
285
PrimitiveType
.Boolean => Decode<bool>(info, reader),
286
PrimitiveType
.Byte => Decode<byte>(info, reader),
287
PrimitiveType
.SByte => Decode<sbyte>(info, reader),
288
PrimitiveType
.Char => Decode<char>(info, reader),
289
PrimitiveType
.Int16 => Decode<short>(info, reader),
290
PrimitiveType
.UInt16 => Decode<ushort>(info, reader),
291
PrimitiveType
.Int32 => Decode<int>(info, reader),
292
PrimitiveType
.UInt32 => Decode<uint>(info, reader),
293
PrimitiveType
.Int64 => Decode<long>(info, reader),
294
PrimitiveType
.UInt64 => Decode<ulong>(info, reader),
295
PrimitiveType
.Single => Decode<float>(info, reader),
296
PrimitiveType
.Double => Decode<double>(info, reader),
297
PrimitiveType
.Decimal => Decode<decimal>(info, reader),
298
PrimitiveType
.DateTime => Decode<DateTime>(info, reader),
299
PrimitiveType
.TimeSpan => Decode<TimeSpan>(info, reader),
307
private static ArrayRecord DecodeArrayRectangularPrimitiveRecord(
PrimitiveType
primitiveType, ArrayInfo info, int[] lengths, BinaryReader reader)
311
PrimitiveType
.Boolean => Decode<bool>(info, lengths, reader),
312
PrimitiveType
.Byte => Decode<byte>(info, lengths, reader),
313
PrimitiveType
.SByte => Decode<sbyte>(info, lengths, reader),
314
PrimitiveType
.Char => Decode<char>(info, lengths, reader),
315
PrimitiveType
.Int16 => Decode<short>(info, lengths, reader),
316
PrimitiveType
.UInt16 => Decode<ushort>(info, lengths, reader),
317
PrimitiveType
.Int32 => Decode<int>(info, lengths, reader),
318
PrimitiveType
.UInt32 => Decode<uint>(info, lengths, reader),
319
PrimitiveType
.Int64 => Decode<long>(info, lengths, reader),
320
PrimitiveType
.UInt64 => Decode<ulong>(info, lengths, reader),
321
PrimitiveType
.Single => Decode<float>(info, lengths, reader),
322
PrimitiveType
.Double => Decode<double>(info, lengths, reader),
323
PrimitiveType
.Decimal => Decode<decimal>(info, lengths, reader),
324
PrimitiveType
.DateTime => Decode<DateTime>(info, lengths, reader),
325
PrimitiveType
.TimeSpan => Decode<TimeSpan>(info, lengths, reader),
386
return DecodeArrayRectangularPrimitiveRecord((
PrimitiveType
)additionalInfo!, arrayInfo, lengths, reader);
428
return DecodeArraySinglePrimitiveRecord(reader, arrayInfo, (
PrimitiveType
)additionalInfo!);
482
(AllowedRecordTypes allowed,
PrimitiveType
primitiveType) = classRecord.GetNextAllowedRecordType();
489
(AllowedRecordTypes allowed,
PrimitiveType
primitiveType) = arrayRecord.GetAllowedRecordType();
System\Formats\Nrbf\RectangularArrayRecord.cs (1)
68
internal override (AllowedRecordTypes allowed,
PrimitiveType
primitiveType) GetAllowedRecordType()
System\Formats\Nrbf\SystemClassWithMembersAndTypesRecord.cs (26)
49
PrimitiveType
primitiveType = (
PrimitiveType
)memberTypeInfo.Infos[0].AdditionalInfo!;
57
(
PrimitiveType
.Boolean, "System.Boolean", "m_value") => Create(reader.ReadBoolean()),
58
(
PrimitiveType
.Byte, "System.Byte", "m_value") => Create(reader.ReadByte()),
59
(
PrimitiveType
.SByte, "System.SByte", "m_value") => Create(reader.ReadSByte()),
60
(
PrimitiveType
.Char, "System.Char", "m_value") => Create(reader.ParseChar()),
61
(
PrimitiveType
.Int16, "System.Int16", "m_value") => Create(reader.ReadInt16()),
62
(
PrimitiveType
.UInt16, "System.UInt16", "m_value") => Create(reader.ReadUInt16()),
63
(
PrimitiveType
.Int32, "System.Int32", "m_value") => Create(reader.ReadInt32()),
64
(
PrimitiveType
.UInt32, "System.UInt32", "m_value") => Create(reader.ReadUInt32()),
65
(
PrimitiveType
.Int64, "System.Int64", "m_value") => Create(reader.ReadInt64()),
66
(
PrimitiveType
.Int64, "System.IntPtr", "value") => Create(new IntPtr(reader.ReadInt64())),
67
(
PrimitiveType
.Int64, "System.TimeSpan", "_ticks") => Create(new TimeSpan(reader.ReadInt64())),
68
(
PrimitiveType
.UInt64, "System.UInt64", "m_value") => Create(reader.ReadUInt64()),
69
(
PrimitiveType
.UInt64, "System.UIntPtr", "value") => Create(new UIntPtr(reader.ReadUInt64())),
70
(
PrimitiveType
.Single, "System.Single", "m_value") => Create(reader.ReadSingle()),
71
(
PrimitiveType
.Double, "System.Double", "m_value") => Create(reader.ReadDouble()),
76
&& HasMember("ticks", 0,
PrimitiveType
.Int64)
77
&& HasMember("dateData", 1,
PrimitiveType
.UInt64))
82
&& HasMember("flags", 0,
PrimitiveType
.Int32)
83
&& HasMember("hi", 1,
PrimitiveType
.Int32)
84
&& HasMember("lo", 2,
PrimitiveType
.Int32)
85
&& HasMember("mid", 3,
PrimitiveType
.Int32))
95
bool HasMember(string name, int order,
PrimitiveType
primitiveType)
98
&& ((
PrimitiveType
)memberTypeInfo.Infos[order].AdditionalInfo!) == primitiveType;
101
internal override (AllowedRecordTypes allowed,
PrimitiveType
primitiveType) GetNextAllowedRecordType()
System\Formats\Nrbf\SZArrayOfRecords.cs (2)
79
internal override (AllowedRecordTypes allowed,
PrimitiveType
primitiveType) GetAllowedRecordType()
81
(AllowedRecordTypes allowed,
PrimitiveType
primitiveType) = MemberTypeInfo.GetNextAllowedRecordType(0);
System\Formats\Nrbf\Utils\BinaryReaderExtensions.cs (20)
66
internal static
PrimitiveType
ReadPrimitiveType(this BinaryReader reader)
70
if (primitiveType is 4 or < (byte)
PrimitiveType
.Boolean or > (byte)
PrimitiveType
.UInt64)
74
return (
PrimitiveType
)primitiveType;
80
internal static object ReadPrimitiveValue(this BinaryReader reader,
PrimitiveType
primitiveType)
83
PrimitiveType
.Boolean => reader.ReadBoolean(),
84
PrimitiveType
.Byte => reader.ReadByte(),
85
PrimitiveType
.SByte => reader.ReadSByte(),
86
PrimitiveType
.Char => reader.ParseChar(),
87
PrimitiveType
.Int16 => reader.ReadInt16(),
88
PrimitiveType
.UInt16 => reader.ReadUInt16(),
89
PrimitiveType
.Int32 => reader.ReadInt32(),
90
PrimitiveType
.UInt32 => reader.ReadUInt32(),
91
PrimitiveType
.Int64 => reader.ReadInt64(),
92
PrimitiveType
.UInt64 => reader.ReadUInt64(),
93
PrimitiveType
.Single => reader.ReadSingle(),
94
PrimitiveType
.Double => reader.ReadDouble(),
95
PrimitiveType
.Decimal => reader.ParseDecimal(),
96
PrimitiveType
.DateTime => CreateDateTimeFromData(reader.ReadUInt64()),
97
PrimitiveType
.TimeSpan => new TimeSpan(reader.ReadInt64()),
System\Formats\Nrbf\Utils\TypeNameHelpers.cs (41)
16
internal const
PrimitiveType
StringPrimitiveType = (
PrimitiveType
)18;
17
internal const
PrimitiveType
ObjectPrimitiveType = (
PrimitiveType
)19;
18
internal const
PrimitiveType
IntPtrPrimitiveType = (
PrimitiveType
)20;
19
internal const
PrimitiveType
UIntPtrPrimitiveType = (
PrimitiveType
)21;
24
internal static TypeName GetPrimitiveTypeName(
PrimitiveType
primitiveType)
31
PrimitiveType
.Boolean => "System.Boolean",
32
PrimitiveType
.Byte => "System.Byte",
33
PrimitiveType
.SByte => "System.SByte",
34
PrimitiveType
.Char => "System.Char",
35
PrimitiveType
.Int16 => "System.Int16",
36
PrimitiveType
.UInt16 => "System.UInt16",
37
PrimitiveType
.Int32 => "System.Int32",
38
PrimitiveType
.UInt32 => "System.UInt32",
39
PrimitiveType
.Int64 => "System.Int64",
40
PrimitiveType
.UInt64 => "System.UInt64",
41
PrimitiveType
.Single => "System.Single",
42
PrimitiveType
.Double => "System.Double",
43
PrimitiveType
.Decimal => "System.Decimal",
44
PrimitiveType
.TimeSpan => "System.TimeSpan",
45
PrimitiveType
.DateTime => "System.DateTime",
58
internal static TypeName GetPrimitiveSZArrayTypeName(
PrimitiveType
primitiveType)
68
internal static
PrimitiveType
GetPrimitiveType<T>()
71
return
PrimitiveType
.Boolean;
73
return
PrimitiveType
.Byte;
75
return
PrimitiveType
.SByte;
77
return
PrimitiveType
.Char;
79
return
PrimitiveType
.Int16;
81
return
PrimitiveType
.UInt16;
83
return
PrimitiveType
.Int32;
85
return
PrimitiveType
.UInt32;
87
return
PrimitiveType
.Int64;
89
return
PrimitiveType
.UInt64;
91
return
PrimitiveType
.Single;
93
return
PrimitiveType
.Double;
95
return
PrimitiveType
.Decimal;
97
return
PrimitiveType
.DateTime;
99
return
PrimitiveType
.TimeSpan;
System.Private.Windows.Core (4)
System\Private\Windows\Core\Nrbf\SerializationRecordExtensions.cs (4)
337
/// Tries to get this object as a <see cref="List{T}"/> of <see cref="
PrimitiveType
"/>.
387
/// Tries to get this object as a <see cref="ArrayList"/> of <see cref="
PrimitiveType
"/> values.
474
/// Tries to get this object as a binary formatted <see cref="Hashtable"/> of <see cref="
PrimitiveType
"/> keys and values.
484
/// Tries to get this object as a binary formatted <see cref="Hashtable"/> of <see cref="
PrimitiveType
"/> keys and values.