Class OneOf
Namespace: Aspose.Svg.Builder
Assembly: Aspose.SVG.dll (25.5.0)
Represents a value that can be one of three distinct types, T1, T2, or T3.
[ComVisible(true)]
public class OneOf<t1, t2,="" t3="">
Type Parameters
T1
The type of the first possible value.
T2
The type of the second possible value.
T3
The type of the third possible value.
Inheritance
object ← OneOf<t1, t2,="" t3="">
Inherited Members
object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Constructors
OneOf(T1)
Initializes a new instance of the OneOf class with a value of type T1.
public OneOf(T1 value)
Parameters
value
T1
The value of type T1.
OneOf(T2)
Initializes a new instance of the OneOf class with a value of type T2.
public OneOf(T2 value)
Parameters
value
T2
The value of type T2.
OneOf(T3)
Initializes a new instance of the OneOf class with a value of type T3.
public OneOf(T3 value)
Parameters
value
T3
The value of type T3.
Methods
Match<tresult>(Func<t1, tresult="">, Func<t2, tresult="">, Func<t3, tresult="">)
Executes one of the provided functions based on the underlying type of the value.
public TResult Match<tresult>(Func<t1, tresult=""> func1, Func<t2, tresult=""> func2, Func<t3, tresult=""> func3)
Parameters
func1
Func
<t1, tresult="">
The function to execute if the value is of type T1.
func2
Func
<t2, tresult="">
The function to execute if the value is of type T2.
func3
Func
<t3, tresult="">
The function to execute if the value is of type T3.
Returns
TResult
The result of the executed function.
Type Parameters
TResult
The return type of the functions.
Operators
implicit operator OneOf<t1, t2,="" t3="">(T1)
Implicitly converts a value of type T1 to a OneOf<T1, T2, T3> object.
public static implicit operator OneOf<t1, t2,="" t3="">(T1 value)
Parameters
value
T1
The value of type T1.
Returns
OneOf <t1, t2,="" t3="">
The result of the conversion.
implicit operator OneOf<t1, t2,="" t3="">(T2)
Implicitly converts a value of type T2 to a OneOf<T1, T2, T3> object.
public static implicit operator OneOf<t1, t2,="" t3="">(T2 value)
Parameters
value
T2
The value of type T2.
Returns
OneOf <t1, t2,="" t3="">
The result of the conversion.
implicit operator OneOf<t1, t2,="" t3="">(T3)
Implicitly converts a value of type T3 to a OneOf<T1, T2, T3> object.
public static implicit operator OneOf<t1, t2,="" t3="">(T3 value)
Parameters
value
T3
The value of type T3.
Returns
OneOf <t1, t2,="" t3="">
The result of the conversion. </t1,></t1,></t1,></t1,></t1,></t1,></t1,></t1,></t1,></t3,></t2,></t1,></t3,></t2,></t1,></t3,></t2,></t1,></tresult></t1,></t1,>