Interface IDataSet
Set that contains items with a ID and name.
Namespace: InsaneScatterbrain.ScriptGraph
Syntax
public interface IDataSet
Properties
Names
Gets the item names.
Declaration
IReadOnlyCollection<string> Names { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<System.String> |
OrderedIds
Gets the item IDs in the order they are stored in the set.
Declaration
ReadOnlyCollection<string> OrderedIds { get; }
Property Value
Type | Description |
---|---|
ReadOnlyCollection<System.String> |
Methods
ContainsId(String)
Gets whether the data set contains an item with the given ID.
Declaration
bool ContainsId(string id)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | The ID. |
Returns
Type | Description |
---|---|
System.Boolean | True if the item exists in the data set, false otherwise. |
ContainsName(String)
Gets whether the data set contains an item with the given name.
Declaration
bool ContainsName(string elementName)
Parameters
Type | Name | Description |
---|---|---|
System.String | elementName | The name. |
Returns
Type | Description |
---|---|
System.Boolean | True if the item exists in the data set, false otherwise. |
GetName(String)
Gets the name of an item with the given ID.
Declaration
string GetName(string id)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | The ID. |
Returns
Type | Description |
---|---|
System.String | The name. |
Move(String, Int32)
Moves the item with the given ID to another index in the set.
Declaration
void Move(string id, int newIndex)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | The item's ID. |
System.Int32 | newIndex | The new index. |
Remove(String)
Remove the item with the given ID from the set.
Declaration
void Remove(string id)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | The ID to remove. |
Rename(String, String)
Renames the item with the given ID.
Declaration
void Rename(string id, string newName)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | The item's ID. |
System.String | newName | The item's new name. |
Events
OnAdded
Event triggered whenever an item is added to the set.
Declaration
event Action<string> OnAdded
Event Type
Type | Description |
---|---|
Action<System.String> |
OnMoved
Event triggered whenever an item is moved from one position to another within the set.
Declaration
event Action<int, int> OnMoved
Event Type
Type | Description |
---|---|
Action<System.Int32, System.Int32> |
OnRemoved
Event triggered whenever an item is removed from the set.
Declaration
event Action<string, string> OnRemoved
Event Type
Type | Description |
---|---|
Action<System.String, System.String> |
OnRenamed
Event triggered whenever an item in the set is renamed.
Declaration
event Action<string, string, string> OnRenamed
Event Type
Type | Description |
---|---|
Action<System.String, System.String, System.String> |