Table of Contents

Class DataViewChange

Namespace
BSGameLib.UI.DataViews
Assembly
BSGameLib.UI.dll

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

bool

Key

The row's key, for SetRow and RemoveRow.

public object Key { get; init; }

Property Value

object

KeyColumn

The column each row of a collection is found by, for SetCollection.

public string KeyColumn { get; init; }

Property Value

string

Kind

What the change does. Decides which of the other properties it uses.

public DataViewChangeKind Kind { get; init; }

Property Value

DataViewChangeKind

Name

The value's, collection's or command's name.

public string Name { get; init; }

Property Value

string

Rows

The rows, for SetCollection; the one row's values, for SetRow.

public IReadOnlyList<IReadOnlyDictionary<string, object>> Rows { get; init; }

Property Value

IReadOnlyList<IReadOnlyDictionary<string, object>>

Value

The value set, for SetValue.

public object Value { get; init; }

Property Value

object

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

name string
keyColumn string
rows IReadOnlyList<IReadOnlyDictionary<string, object>>

Returns

DataViewChange

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

name string
enabled bool

Returns

DataViewChange

Remove(string, object)

A change that removes the row of collection whose key is key.

public static DataViewChange Remove(string collection, object key)

Parameters

collection string
key object

Returns

DataViewChange

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

collection string
key object
values IReadOnlyDictionary<string, object>

Returns

DataViewChange

Set(string, object)

A change that sets the value called name to value.

public static DataViewChange Set(string name, object value)

Parameters

name string
value object

Returns

DataViewChange