From: Richard B. <rb...@ar...> - 2003-09-23 04:02:22
|
Hi, I have added a new class to the framework. The CPersistentCollection class provides a standard collection for persistent objects. However, in addition to the usual Add/Remove functionality there is a new property Public Property CPersistentCollection.ContainerObject() as CPersistentObject When this is set to an object any time you add or remove an item from the collection the dirty flag will be automatically set on the container object. This saves us having to remember to set the flag in forms when we add a line to an order (for example). To use it - just treat it like a normal collection. The Add and Remove methods and the Item property work just as for a normal collection. To make sure the container property is set just add the following to the New() sub in your object, eg Public Sub New() MyBase.New() m_orderlines = new CPersistentCollection m_orderlines.ContainerObject = me ... End Sub Have fun, Richard. |