This event is fired just before a data item is added to the C1 CMS data store. See Add<(Of <<'(TData>)>>)(TData)

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

Syntax

C#
public static event DataEventHandler OnBeforeAdd
Visual Basic
Public Shared Event OnBeforeAdd As DataEventHandler
Visual C++
public:
static  event DataEventHandler^ OnBeforeAdd {
	void add (DataEventHandler^ value);
	void remove (DataEventHandler^ value);
}

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)
{        
}

See Also