BOTranslations on SFUserControl Mishandled when using Miscellaneous Events


BOTranslations on SFUserControl Mishandled when using Miscellaneous...
Author
Message
Kirk M Sherhart
Kirk M Sherhart
StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)StrataFrame Novice (65 reputation)
Group: Forum Members
Posts: 41, Visits: 259
I believe I've found a bug when using BOTranslations on SFUserControls involving the BusinessLayer.CopyEventHandlersFrom method.

I have a BO that implements a "Miscellaneous Event" (in my case, the FieldPropertyChanging event.) The BO is used both on a form and a SFUserControl, using BOTranslations. During the form's initialization, a call is made eventually to the BusinessObjectTranslator.TranslateBusinessObjects method, which eventually calls the BusinessLayer.CopyEventHandlersFrom method.

For all the "standard" events, CopyEventHandlersFrom calls the GetValidInvocationList method to weed out any handlers that shouldn't be copied. However, the code which handles the Miscellaneous events doesn't do this.  Instead, it just makes a direct copy of the destination BO's miscellaneous events to the sourceBO.  

Therefore, CopyEventHandlersFrom leaves the sourceBO with duplicated events (sourceBO's original event + destBO's event).  When the event is raised, a call is eventually made to the destBO's event handler, which promptly causes an exception.

(Just for comparison, when using a CFD, the routine BusinessLayer.PushEventsFrom is called, which handles this situation correctly)
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search