Search Results for

    Show / Hide Table of Contents

    Class DiscriminatorOptions

    Extend this class to configure a type with a discriminator field.

    Inheritance
    System.Object
    DiscriminatorOptions
    Namespace: cqhttp.Cyan.Utils
    Assembly: cqhttp.Cyan.dll
    Syntax
    public abstract class DiscriminatorOptions : object

    Properties

    | Improve this Doc View Source

    Activator

    Callback that creates an object which will then be populated by the serializer.

    Declaration
    public CustomObjectCreator Activator { get; protected set; }
    Property Value
    Type Description
    CustomObjectCreator
    | Improve this Doc View Source

    BaseType

    Gets the base type, which is typically (but not necessarily) abstract.

    Declaration
    public abstract Type BaseType { get; }
    Property Value
    Type Description
    Type
    | Improve this Doc View Source

    DiscriminatorFieldName

    Gets the name of the discriminator field.

    Declaration
    public abstract string DiscriminatorFieldName { get; }
    Property Value
    Type Description
    System.String
    | Improve this Doc View Source

    FallbackType

    Gets the fallback type, which is typically (but not necessarily) abstract.

    Declaration
    public abstract Type FallbackType { get; }
    Property Value
    Type Description
    Type
    | Improve this Doc View Source

    Preprocessor

    Callback that can optionally mutate the JObject before it is converted.

    Declaration
    public JsonPreprocessor Preprocessor { get; protected set; }
    Property Value
    Type Description
    JsonPreprocessor
    | Improve this Doc View Source

    SerializeDiscriminator

    Returns true if the discriminator should be serialized to the CLR type; otherwise false.

    Declaration
    public abstract bool SerializeDiscriminator { get; }
    Property Value
    Type Description
    System.Boolean

    Methods

    | Improve this Doc View Source

    GetDiscriminatedTypes()

    Gets the mappings from discriminator values to CLR types.

    Declaration
    public abstract IEnumerable<(string TypeName, Type Type)> GetDiscriminatedTypes()
    Returns
    Type Description
    IEnumerable<System.ValueTuple<System.String, Type>>
    • Improve this Doc
    • View Source
    ☀
    ☾