...
The Added event is raised when an item is added to the JiwaCollection. The item argument is the item which was added.
The code below shows a handler for a sales order lines, displaying a message box of the PartNo property of the sales order line when added to the collection.
Code Block | ||
---|---|---|
| ||
public class FormPlugin : System.MarshalByRefObject, JiwaFinancials.Jiwa.JiwaApplication.IJiwaFormPlugin
{
public override object InitializeLifetimeService()
{
// returning null here will prevent the lease manager
// from deleting the Object.
return null;
}
public void SetupBeforeHandlers(JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm JiwaForm, JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin)
{
}
public void Setup(JiwaFinancials.Jiwa.JiwaApplication.IJiwaForm JiwaForm, JiwaFinancials.Jiwa.JiwaApplication.Plugin.Plugin Plugin)
{
JiwaFinancials.Jiwa.JiwaSalesUI.SalesOrder.SalesOrderEntryForm salesOrderForm = (JiwaFinancials.Jiwa.JiwaSalesUI.SalesOrder.SalesOrderEntryForm)JiwaForm;
salesOrderForm.SalesOrder.SalesOrderLines.Added += delegate(JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrderLine salesOrderLine)
{
System.Windows.Forms.MessageBox.Show(String.Format("Added '{0}'", salesOrderLine.PartNo));
};
}
} |
Changed
The Changed even is raised when a property if the item changes. The PropertyChangedEventArgs argument has a PropertyName property which contains the name of the property which changed.
...