This is the data item that is the subject of the event fired.
Namespace: Composite.DataAssembly: Composite (in Composite.dll) Version: 5.3.6135.33083
Syntax
C# |
---|
public TData GetData<TData>()
where TData : IData
|
Visual Basic |
---|
Public Function GetData(Of TData As IData) As TData |
Visual C++ |
---|
public:
generic<typename TData>
where TData : IData
TData GetData() |
Type Parameters
Return Value
Returns a casted version of the data item that is the suvject of the event fired.
Examples
CopyC#
void MyMethod()
{
DataEvents<IMyDataType>().OnBeforeAdd += new DataEventHandler(DataEvents_OnBeforeAdd);
using (DataConnection connection = new DataConnection())
{
IMyDataType myDataType = DataConnection.New<IMyDataType>();
myDataType.Name = "Foo";
connection.Add<IMyDataType>(myDataType);
}
}
void DataEvents_OnBeforeAdd(DataEventArgs dataEventArgs)
{
IMyDataType myDataType = dataEventArgs.GetData<IMyDataType>();
}
See Also