Class SoftTrigger
Utility class for subscribing to changes in the database. The current implementation only handles changes made from this instance of NetServer.
Namespace: SuperOffice.Data
Assembly: SoDataBase.dll
Syntax
[SoInject("Database")]
public class SoftTrigger : Object
Constructors
SoftTrigger(ISoftTriggerPlugin[])
Constructur used for unit-testing SoftTrigger and SoftTrigger-plugin implementations.
Declaration
public SoftTrigger(ISoftTriggerPlugin[] plugins)
Parameters
Type | Name | Description |
---|---|---|
ISoftTriggerPlugin[] | plugins |
Methods
HasSubscribers(String)
Check if any pre or post change subscribers are registered for a given table.
Declaration
public bool HasSubscribers(string tableName)
Parameters
Type | Name | Description |
---|---|---|
String | tableName | Table name |
Returns
Type | Description |
---|---|
Boolean |
SubscribeOnPostChange(Int32, SoftTrigger.OnChange)
Subscribe to event raised after the update command is sent to the database.
Declaration
public void SubscribeOnPostChange(int tableNumber, SoftTrigger.OnChange callback)
Parameters
Type | Name | Description |
---|---|---|
Int32 | tableNumber | Table subscribing to modifications for. |
SoftTrigger.OnChange | callback | Callback called when modifications in the database is carried out. |
SubscribeOnPostChange(String, SoftTrigger.OnChange)
Subscribe to event raised after the update command is sent to the database.
Declaration
public void SubscribeOnPostChange(string tableName, SoftTrigger.OnChange callback)
Parameters
Type | Name | Description |
---|---|---|
String | tableName | Table subscribing to modifications for. |
SoftTrigger.OnChange | callback | Callback called when modifications in the database is carried out. |
SubscribeOnPreChange(Int32, SoftTrigger.OnChange)
Subscribe to event raised before the update command is sent to the database.
Declaration
public void SubscribeOnPreChange(int tableNumber, SoftTrigger.OnChange callback)
Parameters
Type | Name | Description |
---|---|---|
Int32 | tableNumber | Table subscribing to modifications for. |
SoftTrigger.OnChange | callback | Callback called when modifications in the database is carried out. |
SubscribeOnPreChange(String, SoftTrigger.OnChange)
Subscribe to event raised before the update command is sent to the database.
Declaration
public void SubscribeOnPreChange(string tableName, SoftTrigger.OnChange callback)
Parameters
Type | Name | Description |
---|---|---|
String | tableName | Table subscribing to modifications for. |
SoftTrigger.OnChange | callback | Callback called when modifications in the database is carried out. |
UnsubscribeOnPostChange(Int32, SoftTrigger.OnChange)
Unsubscribe to event raised after the update command is sent to the database.
Declaration
public void UnsubscribeOnPostChange(int tableNumber, SoftTrigger.OnChange callback)
Parameters
Type | Name | Description |
---|---|---|
Int32 | tableNumber | Table subscribing to modifications for. |
SoftTrigger.OnChange | callback | Callback called when modifications in the database is carried out. |
UnsubscribeOnPostChange(String, SoftTrigger.OnChange)
Unsubscribe to event raised after the update command is sent to the database.
Declaration
public void UnsubscribeOnPostChange(string tableName, SoftTrigger.OnChange callback)
Parameters
Type | Name | Description |
---|---|---|
String | tableName | Table subscribing to modifications for. |
SoftTrigger.OnChange | callback | Callback called when modifications in the database is carried out. |
UnsubscribeOnPreChange(Int32, SoftTrigger.OnChange)
Unsubscribe to event raised before the update command is sent to the database.
Declaration
public void UnsubscribeOnPreChange(int tableNumber, SoftTrigger.OnChange callback)
Parameters
Type | Name | Description |
---|---|---|
Int32 | tableNumber | Table subscribing to modifications for. |
SoftTrigger.OnChange | callback | Callback called when modifications in the database is carried out. |
UnsubscribeOnPreChange(String, SoftTrigger.OnChange)
Unsubscribe to event raised before the update command is sent to the database.
Declaration
public void UnsubscribeOnPreChange(string tableName, SoftTrigger.OnChange callback)
Parameters
Type | Name | Description |
---|---|---|
String | tableName | Table subscribing to modifications for. |
SoftTrigger.OnChange | callback | Callback called when modifications in the database is carried out. |