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)
75internal override (AllowedRecordTypes allowed, PrimitiveType primitiveType) GetAllowedRecordType() 77(AllowedRecordTypes allowed, PrimitiveType primitiveType) = MemberTypeInfo.GetNextAllowedRecordType(0);
System\Formats\Nrbf\ArrayRecord.cs (1)
120internal abstract (AllowedRecordTypes allowed, PrimitiveType primitiveType) GetAllowedRecordType();
System\Formats\Nrbf\ArraySingleObjectRecord.cs (1)
73internal override (AllowedRecordTypes allowed, PrimitiveType primitiveType) GetAllowedRecordType()
System\Formats\Nrbf\ArraySinglePrimitiveRecord.cs (1)
44internal override (AllowedRecordTypes allowed, PrimitiveType primitiveType) GetAllowedRecordType() => throw new InvalidOperationException();
System\Formats\Nrbf\ArraySingleStringRecord.cs (1)
32internal override (AllowedRecordTypes allowed, PrimitiveType primitiveType) GetAllowedRecordType()
System\Formats\Nrbf\BinaryArrayRecord.cs (2)
257internal 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)
143internal abstract (AllowedRecordTypes allowed, PrimitiveType primitiveType) GetNextAllowedRecordType(); 160(AllowedRecordTypes allowed, PrimitiveType primitiveType) = GetNextAllowedRecordType();
System\Formats\Nrbf\ClassWithIdRecord.cs (1)
42internal override (AllowedRecordTypes allowed, PrimitiveType primitiveType) GetNextAllowedRecordType()
System\Formats\Nrbf\ClassWithMembersAndTypesRecord.cs (1)
36internal override (AllowedRecordTypes allowed, PrimitiveType primitiveType) GetNextAllowedRecordType()
System\Formats\Nrbf\MemberTypeInfo.cs (4)
70internal (AllowedRecordTypes allowed, PrimitiveType primitiveType) GetNextAllowedRecordType(int currentValuesCount) 97BinaryType.Primitive => (default, (PrimitiveType)additionalInfo!), 154BinaryType.Primitive => TypeNameHelpers.GetPrimitiveTypeName((PrimitiveType)additionalInfo!), 155BinaryType.PrimitiveArray => TypeNameHelpers.GetPrimitiveSZArrayTypeName((PrimitiveType)additionalInfo!),
System\Formats\Nrbf\NextInfo.cs (3)
13Stack<NextInfo> stack, PrimitiveType primitiveType = default) 27internal PrimitiveType PrimitiveType { get; } 29internal NextInfo With(AllowedRecordTypes allowed, PrimitiveType primitiveType)
System\Formats\Nrbf\NrbfDecoder.cs (34)
249PrimitiveType primitiveType = reader.ReadPrimitiveType(); 253PrimitiveType.Boolean => new MemberPrimitiveTypedRecord<bool>(reader.ReadBoolean()), 254PrimitiveType.Byte => new MemberPrimitiveTypedRecord<byte>(reader.ReadByte()), 255PrimitiveType.SByte => new MemberPrimitiveTypedRecord<sbyte>(reader.ReadSByte()), 256PrimitiveType.Char => new MemberPrimitiveTypedRecord<char>(reader.ParseChar()), 257PrimitiveType.Int16 => new MemberPrimitiveTypedRecord<short>(reader.ReadInt16()), 258PrimitiveType.UInt16 => new MemberPrimitiveTypedRecord<ushort>(reader.ReadUInt16()), 259PrimitiveType.Int32 => new MemberPrimitiveTypedRecord<int>(reader.ReadInt32()), 260PrimitiveType.UInt32 => new MemberPrimitiveTypedRecord<uint>(reader.ReadUInt32()), 261PrimitiveType.Int64 => new MemberPrimitiveTypedRecord<long>(reader.ReadInt64()), 262PrimitiveType.UInt64 => new MemberPrimitiveTypedRecord<ulong>(reader.ReadUInt64()), 263PrimitiveType.Single => new MemberPrimitiveTypedRecord<float>(reader.ReadSingle()), 264PrimitiveType.Double => new MemberPrimitiveTypedRecord<double>(reader.ReadDouble()), 265PrimitiveType.Decimal => new MemberPrimitiveTypedRecord<decimal>(reader.ParseDecimal()), 266PrimitiveType.DateTime => new MemberPrimitiveTypedRecord<DateTime>(Utils.BinaryReaderExtensions.CreateDateTimeFromData(reader.ReadUInt64())), 267PrimitiveType.TimeSpan => new MemberPrimitiveTypedRecord<TimeSpan>(new TimeSpan(reader.ReadInt64())), 275PrimitiveType primitiveType = reader.ReadPrimitiveType(); 279PrimitiveType.Boolean => Decode<bool>(info, reader), 280PrimitiveType.Byte => Decode<byte>(info, reader), 281PrimitiveType.SByte => Decode<sbyte>(info, reader), 282PrimitiveType.Char => Decode<char>(info, reader), 283PrimitiveType.Int16 => Decode<short>(info, reader), 284PrimitiveType.UInt16 => Decode<ushort>(info, reader), 285PrimitiveType.Int32 => Decode<int>(info, reader), 286PrimitiveType.UInt32 => Decode<uint>(info, reader), 287PrimitiveType.Int64 => Decode<long>(info, reader), 288PrimitiveType.UInt64 => Decode<ulong>(info, reader), 289PrimitiveType.Single => Decode<float>(info, reader), 290PrimitiveType.Double => Decode<double>(info, reader), 291PrimitiveType.Decimal => Decode<decimal>(info, reader), 292PrimitiveType.DateTime => Decode<DateTime>(info, reader), 293PrimitiveType.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)
135internal override (AllowedRecordTypes allowed, PrimitiveType primitiveType) GetAllowedRecordType() 137(AllowedRecordTypes allowed, PrimitiveType primitiveType) = MemberTypeInfo.GetNextAllowedRecordType(0); 154BinaryType.Primitive => MapPrimitive((PrimitiveType)memberTypeInfo.Infos[0].AdditionalInfo!), 155BinaryType.PrimitiveArray => MapPrimitiveArray((PrimitiveType)memberTypeInfo.Infos[0].AdditionalInfo!), 164int sizeOfSingleValue = (PrimitiveType)memberTypeInfo.Infos[0].AdditionalInfo! switch 166PrimitiveType.Boolean => sizeof(bool), 167PrimitiveType.Byte => sizeof(byte), 168PrimitiveType.SByte => sizeof(sbyte), 169PrimitiveType.Char => sizeof(byte), // it's UTF8 (see comment below) 170PrimitiveType.Int16 => sizeof(short), 171PrimitiveType.UInt16 => sizeof(ushort), 172PrimitiveType.Int32 => sizeof(int), 173PrimitiveType.UInt32 => sizeof(uint), 174PrimitiveType.Single => sizeof(float), 175PrimitiveType.Int64 => sizeof(long), 176PrimitiveType.UInt64 => sizeof(ulong), 177PrimitiveType.Double => sizeof(double), 178PrimitiveType.TimeSpan => sizeof(ulong), 179PrimitiveType.DateTime => sizeof(ulong), 180PrimitiveType.Decimal => -1, // represented as variable-length string 217private static Type MapPrimitive(PrimitiveType primitiveType) 220PrimitiveType.Boolean => typeof(bool), 221PrimitiveType.Byte => typeof(byte), 222PrimitiveType.Char => typeof(char), 223PrimitiveType.Decimal => typeof(decimal), 224PrimitiveType.Double => typeof(double), 225PrimitiveType.Int16 => typeof(short), 226PrimitiveType.Int32 => typeof(int), 227PrimitiveType.Int64 => typeof(long), 228PrimitiveType.SByte => typeof(sbyte), 229PrimitiveType.Single => typeof(float), 230PrimitiveType.TimeSpan => typeof(TimeSpan), 231PrimitiveType.DateTime => typeof(DateTime), 232PrimitiveType.UInt16 => typeof(ushort), 233PrimitiveType.UInt32 => typeof(uint), 234PrimitiveType.UInt64 => typeof(ulong), 238private static Type MapPrimitiveArray(PrimitiveType primitiveType) 241PrimitiveType.Boolean => typeof(bool[]), 242PrimitiveType.Byte => typeof(byte[]), 243PrimitiveType.Char => typeof(char[]), 244PrimitiveType.Decimal => typeof(decimal[]), 245PrimitiveType.Double => typeof(double[]), 246PrimitiveType.Int16 => typeof(short[]), 247PrimitiveType.Int32 => typeof(int[]), 248PrimitiveType.Int64 => typeof(long[]), 249PrimitiveType.SByte => typeof(sbyte[]), 250PrimitiveType.Single => typeof(float[]), 251PrimitiveType.TimeSpan => typeof(TimeSpan[]), 252PrimitiveType.DateTime => typeof(DateTime[]), 253PrimitiveType.UInt16 => typeof(ushort[]), 254PrimitiveType.UInt32 => typeof(uint[]), 255PrimitiveType.UInt64 => typeof(ulong[]),
System\Formats\Nrbf\SystemClassWithMembersAndTypesRecord.cs (1)
33internal override (AllowedRecordTypes allowed, PrimitiveType primitiveType) GetNextAllowedRecordType()
System\Formats\Nrbf\Utils\BinaryReaderExtensions.cs (20)
66internal static PrimitiveType ReadPrimitiveType(this BinaryReader reader) 70if (primitiveType is 4 or < (byte)PrimitiveType.Boolean or > (byte)PrimitiveType.UInt64) 74return (PrimitiveType)primitiveType; 80internal static object ReadPrimitiveValue(this BinaryReader reader, PrimitiveType primitiveType) 83PrimitiveType.Boolean => reader.ReadBoolean(), 84PrimitiveType.Byte => reader.ReadByte(), 85PrimitiveType.SByte => reader.ReadSByte(), 86PrimitiveType.Char => reader.ParseChar(), 87PrimitiveType.Int16 => reader.ReadInt16(), 88PrimitiveType.UInt16 => reader.ReadUInt16(), 89PrimitiveType.Int32 => reader.ReadInt32(), 90PrimitiveType.UInt32 => reader.ReadUInt32(), 91PrimitiveType.Int64 => reader.ReadInt64(), 92PrimitiveType.UInt64 => reader.ReadUInt64(), 93PrimitiveType.Single => reader.ReadSingle(), 94PrimitiveType.Double => reader.ReadDouble(), 95PrimitiveType.Decimal => reader.ParseDecimal(), 96PrimitiveType.DateTime => CreateDateTimeFromData(reader.ReadUInt64()), 97PrimitiveType.TimeSpan => new TimeSpan(reader.ReadInt64()),
System\Formats\Nrbf\Utils\TypeNameHelpers.cs (41)
16internal const PrimitiveType StringPrimitiveType = (PrimitiveType)18; 17internal const PrimitiveType ObjectPrimitiveType = (PrimitiveType)19; 18internal const PrimitiveType IntPtrPrimitiveType = (PrimitiveType)20; 19internal const PrimitiveType UIntPtrPrimitiveType = (PrimitiveType)21; 24internal static TypeName GetPrimitiveTypeName(PrimitiveType primitiveType) 31PrimitiveType.Boolean => "System.Boolean", 32PrimitiveType.Byte => "System.Byte", 33PrimitiveType.SByte => "System.SByte", 34PrimitiveType.Char => "System.Char", 35PrimitiveType.Int16 => "System.Int16", 36PrimitiveType.UInt16 => "System.UInt16", 37PrimitiveType.Int32 => "System.Int32", 38PrimitiveType.UInt32 => "System.UInt32", 39PrimitiveType.Int64 => "System.Int64", 40PrimitiveType.UInt64 => "System.UInt64", 41PrimitiveType.Single => "System.Single", 42PrimitiveType.Double => "System.Double", 43PrimitiveType.Decimal => "System.Decimal", 44PrimitiveType.TimeSpan => "System.TimeSpan", 45PrimitiveType.DateTime => "System.DateTime", 58internal static TypeName GetPrimitiveSZArrayTypeName(PrimitiveType primitiveType) 68internal static PrimitiveType GetPrimitiveType<T>() 71return PrimitiveType.Boolean; 73return PrimitiveType.Byte; 75return PrimitiveType.SByte; 77return PrimitiveType.Char; 79return PrimitiveType.Int16; 81return PrimitiveType.UInt16; 83return PrimitiveType.Int32; 85return PrimitiveType.UInt32; 87return PrimitiveType.Int64; 89return PrimitiveType.UInt64; 91return PrimitiveType.Single; 93return PrimitiveType.Double; 95return PrimitiveType.Decimal; 97return PrimitiveType.DateTime; 99return 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.