This is the data item that is the subject of the event fired.

Namespace: Composite.Data
Assembly: Composite (in Composite.dll) Version: 5.3.6135.33083

Syntax

C#
public IData Data { get; }
Visual Basic
Public ReadOnly Property Data As IData
	Get
Visual C++
public:
property IData^ Data {
	IData^ get ();
}

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); // This will fire the event!
   }
}


void DataEvents_OnBeforeAdd(object sender, DataEventArgs dataEventArgs)
{        
   IData myData = dataEventArgs.Data; // This will be the myDataType instance just created
}

See Also