CompoundValue Class
Namespace: Microsoft.Modeling
Assembly: Microsoft.Xrt.Runtime (in Microsoft.Xrt.Runtime.dll)
The following C# example defines a Person compound value type. Two persons are considered equal if their names and ages are equal.
class Person : CompoundValue { internal string name; internal int age; internal Person(string name, int age) { this.name = name; this.age = age; } }
The following Cord example uses the Person class in a domain expression.
config PersonDomain
{
domain Person =
{
Person ( name = "Jane", age = 12 ),
Person ( name = "John", age = 10 )
};
}
This class overrides the base implementation of the Equals and GetHashCode methods. Two compound value types are considered equal if they are of the same type and are structurally equal, that is all of their fields are equal.
During exploration, Spec Explorer generates an error state for any transition that changes the value of any field of a compound value type. During exploration, Spec Explorer can substitute one instance of a compound value class for another, provided the two instances are structurally equal.
The Map, Sequence, and Set collection classes derive from the CompoundValue class.
Development Platforms
Microsoft Windows 7, Microsoft Windows Vista, Microsoft Windows XP SP2 or later, Microsoft Windows Server 2008, Microsoft Windows Server 2003