Class DataViewChange
One change to a DataViewModel's state, in a vocabulary that says nothing about where it came from: a game turns its own messages into these, whatever its transport.
public sealed record DataViewChange : IEquatable<DataViewChange>
- Inheritance
-
DataViewChange
- Implements
- Inherited Members
Remarks
Made with the static methods; what a change uses depends on its Kind.
Properties
Enabled
Whether a command is offered, for SetCommand.
public bool Enabled { get; init; }
Property Value
Key
public object Key { get; init; }
Property Value
KeyColumn
The column each row of a collection is found by, for SetCollection.
public string KeyColumn { get; init; }
Property Value
Kind
What the change does. Decides which of the other properties it uses.
public DataViewChangeKind Kind { get; init; }
Property Value
Name
The value's, collection's or command's name.
public string Name { get; init; }
Property Value
Rows
The rows, for SetCollection; the one row's values, for SetRow.
public IReadOnlyList<IReadOnlyDictionary<string, object>> Rows { get; init; }
Property Value
Value
The value set, for SetValue.
public object Value { get; init; }
Property Value
Methods
Collection(string, string, IReadOnlyList<IReadOnlyDictionary<string, object>>)
A change that replaces the collection called name with rows. Each row is found later by its keyColumn value.
public static DataViewChange Collection(string name, string keyColumn, IReadOnlyList<IReadOnlyDictionary<string, object>> rows)
Parameters
namestringkeyColumnstringrowsIReadOnlyList<IReadOnlyDictionary<string, object>>
Returns
Command(string, bool)
A change that offers the command called name, or withdraws it when
enabled is false.
public static DataViewChange Command(string name, bool enabled = true)
Parameters
Returns
Remove(string, object)
A change that removes the row of collection whose key is key.
public static DataViewChange Remove(string collection, object key)
Parameters
Returns
Row(string, object, IReadOnlyDictionary<string, object>)
A change that replaces the row of collection whose key is key with values.
public static DataViewChange Row(string collection, object key, IReadOnlyDictionary<string, object> values)
Parameters
collectionstringkeyobjectvaluesIReadOnlyDictionary<string, object>
Returns
Set(string, object)
A change that sets the value called name to value.
public static DataViewChange Set(string name, object value)