(Type type, TypeInfo typeInfo, WriteContext context)
| 611 | } |
| 612 | |
| 613 | private void WriteNamedTypeInfo(Type type, TypeInfo typeInfo, WriteContext context) |
| 614 | { |
| 615 | if (context.Compatible) |
| 616 | { |
| 617 | TypeInfo.TypeMetaCacheEntry typeMeta = typeInfo.GetTypeMetaCacheEntry(context.TrackRef); |
| 618 | context.WriteTypeMeta(type, typeMeta.EncodedBytes); |
| 619 | return; |
| 620 | } |
| 621 | |
| 622 | if (!typeInfo.NamespaceName.HasValue || !typeInfo.TypeName.HasValue) |
| 623 | { |
| 624 | throw new InvalidDataException("missing type name metadata for name-registered type"); |
| 625 | } |
| 626 | |
| 627 | WriteMetaString( |
| 628 | context, |
| 629 | typeInfo.NamespaceName.Value, |
| 630 | TypeMetaEncodings.NamespaceMetaStringEncodings, |
| 631 | MetaStringEncoder.Namespace); |
| 632 | WriteMetaString( |
| 633 | context, |
| 634 | typeInfo.TypeName.Value, |
| 635 | TypeMetaEncodings.TypeNameMetaStringEncodings, |
| 636 | MetaStringEncoder.TypeName); |
| 637 | } |
| 638 | |
| 639 | internal void ReadTypeInfo<T>(Serializer<T> serializer, ReadContext context) |
| 640 | { |
nothing calls this directly
no test coverage detected