YamlDerivedTypeAttribute Class
Registers a derived type for polymorphic YAML serialization.
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = true)]
public sealed class YamlDerivedTypeAttribute : YamlAttribute- Inheritance
YamlAttributeYamlDerivedTypeAttribute
Constructors
| Name | Description |
|---|---|
| YamlDerivedTypeAttribute(Type) | Initializes a new instance of the YamlDerivedTypeAttribute class with no discriminator. When YamlDerivedTypeAttribute.Tag is also null, this derived type becomes the default when no discriminator or tag matches. When YamlDerivedTypeAttribute.Tag is set, this entry participates only in tag-based dispatch and does not become the default. |
| YamlDerivedTypeAttribute(Type, int) | Initializes a new instance of the YamlDerivedTypeAttribute class with an integer discriminator. |
| YamlDerivedTypeAttribute(Type, string) | Initializes a new instance of the YamlDerivedTypeAttribute class. |
YamlDerivedTypeAttribute overloads
YamlDerivedTypeAttribute(Type)
YamlDerivedTypeAttribute.csInitializes a new instance of the YamlDerivedTypeAttribute class with no discriminator. When YamlDerivedTypeAttribute.Tag is also null, this derived type becomes the default when no discriminator or tag matches. When YamlDerivedTypeAttribute.Tag is set, this entry participates only in tag-based dispatch and does not become the default.
public YamlDerivedTypeAttribute(Type derivedType)YamlDerivedTypeAttribute(Type, int)
YamlDerivedTypeAttribute.csInitializes a new instance of the YamlDerivedTypeAttribute class with an integer discriminator.
YamlDerivedTypeAttribute(Type, string)
YamlDerivedTypeAttribute.csInitializes a new instance of the YamlDerivedTypeAttribute class.
Properties
| Name | Description |
|---|---|
| DerivedType | Gets the derived CLR type. |
| Discriminator | Gets the discriminator value, or null if this is the default derived type. |
| Tag | Gets or sets an optional explicit YAML tag for the derived type. |