This class contains all the event fired by C1 CMS when changes are made to data items.
Use
OnStoreChanged to catch any data change event, including events originating from other servers in a load balance setup
or changes made directly to a store (which C1 CMS can detect). This event do not contain details about the specific data item changed and is raised after the fact.
Use the more detailed operations to catch data events that happen in the current website process. The 'OnBefore' events enable you to manipulate data before they are stored.
The 'OnAfter' events let you react to data changes in detail, for instance updating a cache.
A combination of
OnStoreChanged and the detailed data events can be used to create a highly optimized cache.
Namespace: Composite.DataAssembly: Composite (in Composite.dll) Version: 6.1.6325.31818
Syntax
C# |
---|
public static class DataEvents<TData>
where TData : class, IData
|
Visual Basic |
---|
Public NotInheritable Class DataEvents(Of TData As {Class, IData}) |
Visual C++ |
---|
generic<typename TData>
where TData : ref class, IData
public ref class DataEvents abstract sealed |
Type Parameters
- TData
- Data type to attach events to
Examples
CopyC#
void MyMethod()
{
DataEvents<IMyDataType>.OnBeforeAdd += new DataEventHandler(DataEvents_OnBeforeAdd);
DataEvents<IMyDataType>.OnStoreChanged += new StoreEventHandler(DataEvents_OnStoreChanged);
using (DataConnection connection = new DataConnection())
{
IMyDataType myDataType = DataConnection.New<IMyDataType>();
myDataType.Name = "Foo";
connection.Add<IMyDataType>(myDataType);
}
}
void DataEvents_OnBeforeAdd(object sender, DataEventArgs dataEventArgs)
{
}
void DataEvents_OnStoreChanged(object sender, StoreEventArgs storeEventArgs)
{
if (!storeEventArgs.DataEventsFired)
{
}
}
Inheritance Hierarchy
See Also