Here is the problem... I load a collection using collection1.Load(query) call, then change the query, create another collection and load the second collection with the modified query: collection2.Load(query). The second call removes data from the collection1 and populates both collections with data from the second Load() call.
I think the problem is in the HookupQuery/InityQuery pair inside the generated collection class. These methods hookup the event handler to the query:
query.OnLoadEvent +=
new esDynamicQuery.QueryLoadedDelegate(OnQueryLoaded);
but never remove the event handler. This code shoul be better changed to disconnect the event before attaching it:
query.OnLoadEvent -= new esDynamicQuery.QueryLoadedDelegate(OnQueryLoaded);
query.OnLoadEvent += new esDynamicQuery.QueryLoadedDelegate(OnQueryLoaded);
Is there a workaround for this problem or should I recreate a query for the second call?
Thanks,
Leonid