Class VariantBase
Used internally to implement Variant types.
Inheritance
System.Object
VariantBase
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Maki.Details
Assembly: Maki.dll
Syntax
public abstract class VariantBase
Properties
| Improve this Doc View SourceIndex
Gets the 0-based index of the type inhabiting the variant.
Declaration
public byte Index { get; }
Property Value
Type | Description |
---|---|
System.Byte |
Methods
| Improve this Doc View SourceEquals(Object)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The object to compare with the current object. |
Returns
Type | Description |
---|---|
System.Boolean | True if the objects are equal. |
Overrides
System.Object.Equals(System.Object)
|
Improve this Doc
View Source
Get()
Gets the item inhabiting the variant as an object.
Declaration
public object Get()
Returns
Type | Description |
---|---|
System.Object | Item inhabiting the variant as an object. |
Get<T>()
Gets the item inhabiting the variant as a
T
.
Declaration
public T Get<T>()
Returns
Type | Description |
---|---|
T | Item inhabiting the variant as the given type |
Type Parameters
Name | Description |
---|---|
T | Should be one of the variant's supplied types. |
Exceptions
Type | Condition |
---|---|
System.InvalidCastException | Thrown if the item inhabiting the variant is not of type |
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | Hash code. |
Overrides
System.Object.GetHashCode()
|
Improve this Doc
View Source
Is<T>()
Returns a value that indicates whether the variant is inhabited by an item of type
T
.
Declaration
public bool Is<T>()
Returns
Type | Description |
---|---|
System.Boolean | True if the variant is inhabited by an item of type |
Type Parameters
Name | Description |
---|---|
T | Should be one of the variant's supplied types. |