Class DataTableTracker
A observer-like pattern for DataTableBase usage in the editor.
Inheritance
Namespace: GDX.Editor
Syntax
public static class DataTableTracker
Remarks
This is useful for driving updates across multiple windows, inspectors and property drawers.
Methods
| Improve this Doc View SourceAddUsage(Int32)
Indicate that a DataTableBase is being used by something.
Declaration
public static void AddUsage(int tableTicket)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | tableTicket | The unique ticket generated by RegisterTable(DataTableBase). |
GetStats(Int32)
Get the summary of currently what is being tracked by the DataTableTracker for a DataTableBase.
Declaration
public static DataTableTracker.DataTableTrackerStats GetStats(int tableTicket)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | tableTicket | The unique ticket generated by RegisterTable(DataTableBase). |
Returns
Type | Description |
---|---|
DataTableTracker.DataTableTrackerStats |
GetTable(Int32)
Attempt to get the registered DataTableBase by ticket number.
Declaration
public static DataTableBase GetTable(int tableTicket)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | tableTicket | The unique ticket generated by RegisterTable(DataTableBase). |
Returns
Type | Description |
---|---|
DataTableBase | A DataTableBase if found, otherwise null. |
GetTicket(DataTableBase)
Attempt to get the ticket number of the provided DataTableBase.
Declaration
public static int GetTicket(DataTableBase dataTable)
Parameters
Type | Name | Description |
---|---|---|
DataTableBase | dataTable | The target DataTableBase. |
Returns
Type | Description |
---|---|
System.Int32 | A ticket number, otherwise -1. |
NotifyOfCellValueChange(Int32, Int32, Int32, DataTableTracker.ICellValueChangedCallbackReceiver)
Notify all registered DataTableTracker.ICellValueChangedCallbackReceivers that a change has occured.
Declaration
public static void NotifyOfCellValueChange(int tableTicket, int rowIdentifier, int columnIdentifier, DataTableTracker.ICellValueChangedCallbackReceiver ignoreReceiver = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | tableTicket | The unique ticket generated by RegisterTable(DataTableBase). |
System.Int32 | rowIdentifier | The affected row's unique identifier. |
System.Int32 | columnIdentifier | The affected column's unique identifier. |
DataTableTracker.ICellValueChangedCallbackReceiver | ignoreReceiver | A DataTableTracker.ICellValueChangedCallbackReceiver that should be ignored in the notification process. This is used to stop self-notification. |
Remarks
Marks the changed DataTableBase as dirty.
NotifyOfColumnChange(Int32, Int32, DataTableTracker.IStructuralChangeCallbackReceiver)
Notify all registered DataTableTracker.IStructuralChangeCallbackReceivers that a change has occured.
Declaration
public static void NotifyOfColumnChange(int tableTicket, int columnIdentifier, DataTableTracker.IStructuralChangeCallbackReceiver ignoreReceiver = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | tableTicket | The unique ticket generated by RegisterTable(DataTableBase). |
System.Int32 | columnIdentifier | The affected column's unique identifier. |
DataTableTracker.IStructuralChangeCallbackReceiver | ignoreReceiver | A DataTableTracker.IStructuralChangeCallbackReceiver that should be ignored in the notification process. This is used to stop self-notification. |
Remarks
Marks the changed DataTableBase as dirty.
NotifyOfRowChange(Int32, Int32, DataTableTracker.IStructuralChangeCallbackReceiver)
Notify all registered DataTableTracker.IStructuralChangeCallbackReceivers that a row change has occured.
Declaration
public static void NotifyOfRowChange(int tableTicket, int rowIdentifier, DataTableTracker.IStructuralChangeCallbackReceiver ignoreReceiver = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | tableTicket | The unique ticket generated by RegisterTable(DataTableBase). |
System.Int32 | rowIdentifier | The affected row's unique identifier. |
DataTableTracker.IStructuralChangeCallbackReceiver | ignoreReceiver | A DataTableTracker.IStructuralChangeCallbackReceiver that should be ignored in the notification process. This is used to stop self-notification. |
Remarks
Marks the changed DataTableBase as dirty.
NotifyOfSettingsChange(Int32, DataTableTracker.IStructuralChangeCallbackReceiver)
Notify all registered DataTableTracker.IStructuralChangeCallbackReceivers that a setting change has occured.
Declaration
public static void NotifyOfSettingsChange(int tableTicket, DataTableTracker.IStructuralChangeCallbackReceiver ignoreReceiver = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | tableTicket | The unique ticket generated by RegisterTable(DataTableBase). |
DataTableTracker.IStructuralChangeCallbackReceiver | ignoreReceiver | A DataTableTracker.IStructuralChangeCallbackReceiver that should be ignored in the notification process. This is used to stop self-notification. |
Remarks
Marks the changed DataTableBase as dirty.
RecordCellValueUndo(Int32, Int32, Int32)
Record the state of a DataTableBase for undoing a cell value change.
Declaration
public static void RecordCellValueUndo(int tableTicket, int rowIdentifier, int columnIdentifier)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | tableTicket | The unique ticket generated by RegisterTable(DataTableBase). |
System.Int32 | rowIdentifier | The affected row's unique identifier. |
System.Int32 | columnIdentifier | The affected column's unique identifier. |
RecordColumnDefinitionUndo(Int32, Int32, String)
Record the state of a DataTableBase for undoing a column definition change.
Declaration
public static void RecordColumnDefinitionUndo(int tableTicket, int columnIdentifier, string actionDescription = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | tableTicket | The unique ticket generated by RegisterTable(DataTableBase). |
System.Int32 | columnIdentifier | The affected column's unique identifier. |
System.String | actionDescription | A description of the action being done. |
RecordRowDefinitionUndo(Int32, Int32, String)
Record the state of a DataTableBase for undoing a row definition change.
Declaration
public static void RecordRowDefinitionUndo(int tableTicket, int rowIdentifier, string actionDescription = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | tableTicket | The unique ticket generated by RegisterTable(DataTableBase). |
System.Int32 | rowIdentifier | The affected row's unique identifier. |
System.String | actionDescription | A description of the action being done. |
RecordSettingsUndo(Int32)
Record the state of a DataTableBase for undoing a settings change.
Declaration
public static void RecordSettingsUndo(int tableTicket)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | tableTicket | The unique ticket generated by RegisterTable(DataTableBase). |
RegisterCellValueChanged(DataTableTracker.ICellValueChangedCallbackReceiver, Int32)
Register an DataTableTracker.ICellValueChangedCallbackReceiver for callbacks based on the provided ticket.
Declaration
public static void RegisterCellValueChanged(DataTableTracker.ICellValueChangedCallbackReceiver callback, int tableTicket)
Parameters
Type | Name | Description |
---|---|---|
DataTableTracker.ICellValueChangedCallbackReceiver | callback | The target receiver to add to the callback list. |
System.Int32 | tableTicket | The unique ticket generated by RegisterTable(DataTableBase). |
RegisterStructuralChanged(DataTableTracker.IStructuralChangeCallbackReceiver, Int32)
Register a DataTableTracker.IStructuralChangeCallbackReceiver for callbacks based on the provided ticket.
Declaration
public static void RegisterStructuralChanged(DataTableTracker.IStructuralChangeCallbackReceiver callback, int tableTicket)
Parameters
Type | Name | Description |
---|---|---|
DataTableTracker.IStructuralChangeCallbackReceiver | callback | The target receiver to add to the callback list. |
System.Int32 | tableTicket | The unique ticket generated by RegisterTable(DataTableBase). |
RegisterTable(DataTableBase)
Registers a DataTableBase for use by all of the different supporting systems inside of the Unity editor.
Declaration
public static int RegisterTable(DataTableBase dataTable)
Parameters
Type | Name | Description |
---|---|---|
DataTableBase | dataTable | The DataTableBase to be registered for use. |
Returns
Type | Description |
---|---|
System.Int32 | A domain incremented ticket number. |
RegisterTableAfterReload(DataTableBase, Int32)
Registers a DataTableBase for use after a domain reload or undo/redo.
Declaration
public static int RegisterTableAfterReload(DataTableBase dataTable, int tableTicket)
Parameters
Type | Name | Description |
---|---|---|
DataTableBase | dataTable | The DataTableBase to be registered for use. |
System.Int32 | tableTicket | Force a specific ticket to be used for a table. |
Returns
Type | Description |
---|---|
System.Int32 | A domain incremented ticket number. |
RegisterUndoRedoEvent(DataTableTracker.IUndoRedoEventCallbackReceiver, Int32)
Register an DataTableTracker.IUndoRedoEventCallbackReceiver for callbacks based on the provided ticket.
Declaration
public static void RegisterUndoRedoEvent(DataTableTracker.IUndoRedoEventCallbackReceiver callback, int tableTicket)
Parameters
Type | Name | Description |
---|---|---|
DataTableTracker.IUndoRedoEventCallbackReceiver | callback | The target receiver to add to the callback list. |
System.Int32 | tableTicket | The unique ticket generated by RegisterTable(DataTableBase). |
RemoveUsage(Int32)
Indicate that a DataTableBase is no longer being used by something.
Declaration
public static void RemoveUsage(int tableTicket)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | tableTicket | The unique ticket generated by RegisterTable(DataTableBase). |
Remarks
When there are no more usages, a cleanup pass is ran to remove other mappings.
UnregisterCellValueChanged(DataTableTracker.ICellValueChangedCallbackReceiver, Int32)
Unregister an DataTableTracker.ICellValueChangedCallbackReceiver from callbacks based on the provided ticket.
Declaration
public static void UnregisterCellValueChanged(DataTableTracker.ICellValueChangedCallbackReceiver callback, int tableTicket)
Parameters
Type | Name | Description |
---|---|---|
DataTableTracker.ICellValueChangedCallbackReceiver | callback | The target receiver to remove from the callback list. |
System.Int32 | tableTicket | The unique ticket generated by RegisterTable(DataTableBase). |
UnregisterStructuralChanged(DataTableTracker.IStructuralChangeCallbackReceiver, Int32)
Unregister an DataTableTracker.IStructuralChangeCallbackReceiver from callbacks based on the provided ticket.
Declaration
public static void UnregisterStructuralChanged(DataTableTracker.IStructuralChangeCallbackReceiver callback, int tableTicket)
Parameters
Type | Name | Description |
---|---|---|
DataTableTracker.IStructuralChangeCallbackReceiver | callback | The target receiver to remove from the callback list. |
System.Int32 | tableTicket | The unique ticket generated by RegisterTable(DataTableBase). |
UnregisterUndoRedoEvent(DataTableTracker.IUndoRedoEventCallbackReceiver, Int32)
Unregister an DataTableTracker.IUndoRedoEventCallbackReceiver from callbacks based on the provided ticket.
Declaration
public static void UnregisterUndoRedoEvent(DataTableTracker.IUndoRedoEventCallbackReceiver callback, int tableTicket)
Parameters
Type | Name | Description |
---|---|---|
DataTableTracker.IUndoRedoEventCallbackReceiver | callback | The target receiver to remove from the callback list. |
System.Int32 | tableTicket | The unique ticket generated by RegisterTable(DataTableBase). |