Class
OfficeDerivedTypeAttribute
OfficeIMO
Registers a derived type of the annotated class or interface for polymorphic serialization. A value of the derived type is written with its discriminator, and reading creates the derived type only for that discriminator: the input never names a .NET type by itself.
Inheritance
- Attribute
- OfficeDerivedTypeAttribute
Remarks
YAML writes the discriminator as the local tag !discriminator by default. TOML has no tags, so it writes the discriminator as a key, $type by default. OfficePolymorphicAttribute.DiscriminatorPropertyName on the base type makes both formats use a key with that name.
Constructors
public OfficeDerivedTypeAttribute(Type derivedType, string discriminator) #Creates the attribute.
Parameters
- derivedType System.Type
- A concrete type that derives from or implements the annotated type.
- discriminator string
- The text that identifies derivedType in the serialized form.
Inherited Methods
Properties
Inherited Properties
public virtual object TypeId { get; } #Inherited from Attribute