175 references to PrimitiveType
PresentationCore (3)
System\Windows\Nrbf\SerializationRecordExtensions.cs (3)
116
/// Trys to get this object as a <see cref="List{T}"/> of <see cref="
PrimitiveType
"/>.
166
/// Tries to get this object as a <see cref="ArrayList"/> of <see cref="
PrimitiveType
"/> values.
245
/// Trys to get this object as a binary recordted <see cref="Hashtable"/> of <see cref="
PrimitiveType
"/> keys and values.
System.Formats.Nrbf (168)
System\Formats\Nrbf\ArrayOfClassesRecord.cs (2)
75
internal override (AllowedRecordTypes allowed,
PrimitiveType
primitiveType) GetAllowedRecordType()
77
(AllowedRecordTypes allowed,
PrimitiveType
primitiveType) = MemberTypeInfo.GetNextAllowedRecordType(0);
System\Formats\Nrbf\ArrayRecord.cs (1)
120
internal abstract (AllowedRecordTypes allowed,
PrimitiveType
primitiveType) GetAllowedRecordType();
System\Formats\Nrbf\ArraySingleObjectRecord.cs (1)
73
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\BinaryArrayRecord.cs (2)
257
internal override (AllowedRecordTypes allowed,
PrimitiveType
primitiveType) GetAllowedRecordType()
259
(AllowedRecordTypes allowed,
PrimitiveType
primitiveType) = MemberTypeInfo.GetNextAllowedRecordType(0);
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)
42
internal override (AllowedRecordTypes allowed,
PrimitiveType
primitiveType) GetNextAllowedRecordType()
System\Formats\Nrbf\ClassWithMembersAndTypesRecord.cs (1)
36
internal override (AllowedRecordTypes allowed,
PrimitiveType
primitiveType) GetNextAllowedRecordType()
System\Formats\Nrbf\MemberTypeInfo.cs (4)
70
internal (AllowedRecordTypes allowed,
PrimitiveType
primitiveType) GetNextAllowedRecordType(int currentValuesCount)
97
BinaryType.Primitive => (default, (
PrimitiveType
)additionalInfo!),
154
BinaryType.Primitive => TypeNameHelpers.GetPrimitiveTypeName((
PrimitiveType
)additionalInfo!),
155
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 (34)
249
PrimitiveType
primitiveType = reader.ReadPrimitiveType();
253
PrimitiveType
.Boolean => new MemberPrimitiveTypedRecord<bool>(reader.ReadBoolean()),
254
PrimitiveType
.Byte => new MemberPrimitiveTypedRecord<byte>(reader.ReadByte()),
255
PrimitiveType
.SByte => new MemberPrimitiveTypedRecord<sbyte>(reader.ReadSByte()),
256
PrimitiveType
.Char => new MemberPrimitiveTypedRecord<char>(reader.ParseChar()),
257
PrimitiveType
.Int16 => new MemberPrimitiveTypedRecord<short>(reader.ReadInt16()),
258
PrimitiveType
.UInt16 => new MemberPrimitiveTypedRecord<ushort>(reader.ReadUInt16()),
259
PrimitiveType
.Int32 => new MemberPrimitiveTypedRecord<int>(reader.ReadInt32()),
260
PrimitiveType
.UInt32 => new MemberPrimitiveTypedRecord<uint>(reader.ReadUInt32()),
261
PrimitiveType
.Int64 => new MemberPrimitiveTypedRecord<long>(reader.ReadInt64()),
262
PrimitiveType
.UInt64 => new MemberPrimitiveTypedRecord<ulong>(reader.ReadUInt64()),
263
PrimitiveType
.Single => new MemberPrimitiveTypedRecord<float>(reader.ReadSingle()),
264
PrimitiveType
.Double => new MemberPrimitiveTypedRecord<double>(reader.ReadDouble()),
265
PrimitiveType
.Decimal => new MemberPrimitiveTypedRecord<decimal>(reader.ParseDecimal()),
266
PrimitiveType
.DateTime => new MemberPrimitiveTypedRecord<DateTime>(Utils.BinaryReaderExtensions.CreateDateTimeFromData(reader.ReadUInt64())),
267
PrimitiveType
.TimeSpan => new MemberPrimitiveTypedRecord<TimeSpan>(new TimeSpan(reader.ReadInt64())),
275
PrimitiveType
primitiveType = reader.ReadPrimitiveType();
279
PrimitiveType
.Boolean => Decode<bool>(info, reader),
280
PrimitiveType
.Byte => Decode<byte>(info, reader),
281
PrimitiveType
.SByte => Decode<sbyte>(info, reader),
282
PrimitiveType
.Char => Decode<char>(info, reader),
283
PrimitiveType
.Int16 => Decode<short>(info, reader),
284
PrimitiveType
.UInt16 => Decode<ushort>(info, reader),
285
PrimitiveType
.Int32 => Decode<int>(info, reader),
286
PrimitiveType
.UInt32 => Decode<uint>(info, reader),
287
PrimitiveType
.Int64 => Decode<long>(info, reader),
288
PrimitiveType
.UInt64 => Decode<ulong>(info, reader),
289
PrimitiveType
.Single => Decode<float>(info, reader),
290
PrimitiveType
.Double => Decode<double>(info, reader),
291
PrimitiveType
.Decimal => Decode<decimal>(info, reader),
292
PrimitiveType
.DateTime => Decode<DateTime>(info, reader),
293
PrimitiveType
.TimeSpan => Decode<TimeSpan>(info, reader),
315
(AllowedRecordTypes allowed,
PrimitiveType
primitiveType) = classRecord.GetNextAllowedRecordType();
322
(AllowedRecordTypes allowed,
PrimitiveType
primitiveType) = arrayRecord.GetAllowedRecordType();
System\Formats\Nrbf\RectangularArrayRecord.cs (52)
135
internal override (AllowedRecordTypes allowed,
PrimitiveType
primitiveType) GetAllowedRecordType()
137
(AllowedRecordTypes allowed,
PrimitiveType
primitiveType) = MemberTypeInfo.GetNextAllowedRecordType(0);
154
BinaryType.Primitive => MapPrimitive((
PrimitiveType
)memberTypeInfo.Infos[0].AdditionalInfo!),
155
BinaryType.PrimitiveArray => MapPrimitiveArray((
PrimitiveType
)memberTypeInfo.Infos[0].AdditionalInfo!),
164
int sizeOfSingleValue = (
PrimitiveType
)memberTypeInfo.Infos[0].AdditionalInfo! switch
166
PrimitiveType
.Boolean => sizeof(bool),
167
PrimitiveType
.Byte => sizeof(byte),
168
PrimitiveType
.SByte => sizeof(sbyte),
169
PrimitiveType
.Char => sizeof(byte), // it's UTF8 (see comment below)
170
PrimitiveType
.Int16 => sizeof(short),
171
PrimitiveType
.UInt16 => sizeof(ushort),
172
PrimitiveType
.Int32 => sizeof(int),
173
PrimitiveType
.UInt32 => sizeof(uint),
174
PrimitiveType
.Single => sizeof(float),
175
PrimitiveType
.Int64 => sizeof(long),
176
PrimitiveType
.UInt64 => sizeof(ulong),
177
PrimitiveType
.Double => sizeof(double),
178
PrimitiveType
.TimeSpan => sizeof(ulong),
179
PrimitiveType
.DateTime => sizeof(ulong),
180
PrimitiveType
.Decimal => -1, // represented as variable-length string
217
private static Type MapPrimitive(
PrimitiveType
primitiveType)
220
PrimitiveType
.Boolean => typeof(bool),
221
PrimitiveType
.Byte => typeof(byte),
222
PrimitiveType
.Char => typeof(char),
223
PrimitiveType
.Decimal => typeof(decimal),
224
PrimitiveType
.Double => typeof(double),
225
PrimitiveType
.Int16 => typeof(short),
226
PrimitiveType
.Int32 => typeof(int),
227
PrimitiveType
.Int64 => typeof(long),
228
PrimitiveType
.SByte => typeof(sbyte),
229
PrimitiveType
.Single => typeof(float),
230
PrimitiveType
.TimeSpan => typeof(TimeSpan),
231
PrimitiveType
.DateTime => typeof(DateTime),
232
PrimitiveType
.UInt16 => typeof(ushort),
233
PrimitiveType
.UInt32 => typeof(uint),
234
PrimitiveType
.UInt64 => typeof(ulong),
238
private static Type MapPrimitiveArray(
PrimitiveType
primitiveType)
241
PrimitiveType
.Boolean => typeof(bool[]),
242
PrimitiveType
.Byte => typeof(byte[]),
243
PrimitiveType
.Char => typeof(char[]),
244
PrimitiveType
.Decimal => typeof(decimal[]),
245
PrimitiveType
.Double => typeof(double[]),
246
PrimitiveType
.Int16 => typeof(short[]),
247
PrimitiveType
.Int32 => typeof(int[]),
248
PrimitiveType
.Int64 => typeof(long[]),
249
PrimitiveType
.SByte => typeof(sbyte[]),
250
PrimitiveType
.Single => typeof(float[]),
251
PrimitiveType
.TimeSpan => typeof(TimeSpan[]),
252
PrimitiveType
.DateTime => typeof(DateTime[]),
253
PrimitiveType
.UInt16 => typeof(ushort[]),
254
PrimitiveType
.UInt32 => typeof(uint[]),
255
PrimitiveType
.UInt64 => typeof(ulong[]),
System\Formats\Nrbf\SystemClassWithMembersAndTypesRecord.cs (1)
33
internal override (AllowedRecordTypes allowed,
PrimitiveType
primitiveType) GetNextAllowedRecordType()
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)
294
/// Tries to get this object as a <see cref="List{T}"/> of <see cref="
PrimitiveType
"/>.
344
/// Tries to get this object as a <see cref="ArrayList"/> of <see cref="
PrimitiveType
"/> values.
423
/// Tries to get this object as a binary formatted <see cref="Hashtable"/> of <see cref="
PrimitiveType
"/> keys and values.
433
/// Tries to get this object as a binary formatted <see cref="Hashtable"/> of <see cref="
PrimitiveType
"/> keys and values.