Menu

New version 2.0.1

2005-02-17
2013-03-07
  • victor Saquicela

    I have a mistake:

    C:\Proyectos\Ventas\Gestion de Pedidos\DetalleFacturaVenta.vb(25): 'Public Property ContainerObject() As AToMSFramework.CPersistentObject' est obsoleta: 'Changes in collection management have made this obsolete.  Please use the ListChanged event for equivalent functionality'

    what happen?

     
    • Richard Banks

      Richard Banks - 2005-02-17

      It's not a mistake, it's a compiler warning.

      With the change to handle collection state before and after transaction rollback I discovered some issues with copying objects and handling references etc.

      As a result I discovered that the ContainerObject property is unreliable and can incorrectly dirty a different object than expected (due to reference copying).

      I haven't managed to fix it properly, but I have fixed the events.  What this means is that you should be capturing the ListChanged event of the collection and setting your dirty flag manually.

      For example

      Imports System.ComponentModel
      Class MyClass
        Inherits CPersistentObject

        Private WithEvents MyColl as CPersistentCollection
        ...

        Private Sub MyColl_ListChanged(ByVal sender as Object, ByVal e as ListChangedEventArgs) Handles MyColl.ListChanged
          Me.SetDirtyFlag
        End Sub
      End Class

      If you don't change the code then you are unlikely to get the dirty flag set on the parent object when the collection changes.

      - Richard.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.