MutableTuple Class
Definition
Represents a MutableTuple with an empty value.
public class MutableTuple
- Inheritance
-
objectMutableTuple
- Derived
Examples
The following example demonstrates how to create and use MutableTuple and its generic variants to store and pass multiple values without creating a custom class.
using System;
using Cuemon;
namespace Contoso.Workflow;
public sealed class MutableTupleExample
{
public static void Run()
{
MutableTuple empty = new MutableTuple();
var pair = new MutableTuple<string, int>("Alice", 30);
pair.Arg2 = 31;
object[] values = pair.ToArray("verified");
var clone = (MutableTuple<string, int>)pair.Clone();
Console.WriteLine($"Empty: {empty.IsEmpty}");
Console.WriteLine($"{clone.Arg1}:{clone.Arg2}");
Console.WriteLine($"Array length: {values.Length}");
}
}
Constructors
| Name | Description |
|---|---|
| MutableTuple() | Initializes a new instance of the MutableTuple class. |
Properties
| Name | Description |
|---|---|
| IsEmpty | Gets a value indicating whether this MutableTuple is empty. |
Methods
| Name | Description |
|---|---|
| Clone() | Creates a shallow copy of the current MutableTuple object. |
| ToArray() | Returns an array of objects that represent the arguments passed to this instance. |
| ToArray(params object[]) | Returns an array of objects that represent the arguments passed to this instance concatenated with the specified |
| ToString() | Returns a string that represents this instance. |