StrataFrame Forum
Back
Login
Login
Home
»
StrataFrame Application Framework - V1
»
Issues
»
BOTranslations on SFUserControl Mishandled when using Miscellaneous...
BOTranslations on SFUserControl Mishandled when using Miscellaneous Events
Post Reply
Like
1
BOTranslations on SFUserControl Mishandled when using Miscellaneous...
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
RSS Feed
Goto Topics Forum
Author
Message
Kirk M Sherhart
Kirk M Sherhart
posted 12 Years Ago
ANSWER
Topic Details
Share Topic
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)
Tags
BOTranslation
Miscellaneous Event
SFUserControl
Reply
Like
1
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Post Reply
Like
1
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search