API ReferenceSandbox
public sealed struct Sandbox.Variant
A Variant is a type that can hold any value, and also keeps track of the type of the value it holds. It's useful for cases where you want to store a value of an unknown type, or when you want to serialize/deserialize values of various types in a generic way.
Related Guides
Broader workflow and conceptual references connected to this API.
Constructors
Showing 1 constructors
No results match this filter.
Methods
Showing 3 methods
public T Get()
public static override object JsonRead(System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert)
public static override void JsonWrite(object value, System.Text.Json.Utf8JsonWriter writer)
No results match this filter.
Properties
Showing 2 properties
public System.Type Sandbox.Variant.Type { get; set; }
The type of the value currently stored in the Variant. This is automatically set when you assign a value to the Variant.
public object Sandbox.Variant.Value { get; set; }
Gets or sets the value associated with this instance.
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Sandbox |
| Type | class |
| Assembly | Sandbox.Engine |
| Doc ID | T:Sandbox.Variant |