OnListChanged Remoting v2.1.4

OnListChanged Remoting v2.1.4

Old forum URL: forums.lhotka.net/forums/t/3965.aspx


Robert Schmidt posted on Friday, November 30, 2007

Sorry if this is a rehash of an existing thread but I wasn't able to find one that addressed my issue specifically.

As indicated above I am using v2.1.4 of Csla and .Net Remoting.

I have the following object structure using BusinessBase and BusinessListBase;

HeaderCollection > Header > DetailCollection > Detail

When I change a property in the Detail it only bubbles up as far as DetailCollection. In other words the OnListChanged() overide code in the DetailCollection is called but the event handler in the Header is never called. My code in the OnListChanged() overide only contains a call to base.OnListChanged (just so I can see it being called). I hook up the event in the Headers Fetch method as follows;

    private void Fetch(SafeDataReader sdr)
    {
      ...
      this._details = DetailCollection.GetCollection(this._id);
      this._details.ListChanged += new ListChangedEventHandler(Details_ListChanged);
      MarkOld();
    }

This works fine when not using remoting (client server) but when Remoting is turned on Details_ListChanged never gets called.

I suspect I am hooking up the event incorrectly.

Any assistance you can provide would be appreciated.

 

skagen00 replied on Friday, November 30, 2007

Make sure you are also rehooking any events after deserialization by overriding OnDeserialized.

protected override void OnDeserialized(System.Runtime.Serialization.StreamingContext context)

{

   rehook your events up

}

 

 

Robert Schmidt replied on Friday, November 30, 2007

That was it skagen! Thanks. I suspected this was a problem with the carbon based interface rather than csla...

Copyright (c) Marimer LLC