Using property as a string to resolve at runtime to an object reference


Author
Message
Charles R Hankey
Charles R Hankey
Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)Advanced StrataFrame User (922 reputation)
Group: Forum Members
Posts: 524, Visits: 30K
I have a piece of code in a form :





Private Sub lvSelections_ListPopulating(ByVal e As MicroFour.StrataFrame.UI.ListPopulatingEventArgs) _

Handles lvSelections.ListPopulating



e.Parameters(0).Value = Me.Vr_PolicyHolderListBO1

e.Parameters(1).Value = _

MicroFour.StrataFrame.Business.BusinessCloneDataType.ClearAndFillFromCompleteTable

End Sub



Private Sub btnViewReport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _

Handles btnViewReport.Click

UI.FormManager.OpenReport(GetType(InsurtecPH.Reporting.Forms.PolicyHolderListReportForm), _

New Object() {Me.Vr_PolicyHolderListBO1}, False)

End Sub




I want to have properties that can be set at design time that at run-time will result in the BO references being set to the object referred to by the property and ReportForm likewise.



Since the form is in a different assembly and for simplicity sake it seems two string properties would do the trick but I am open to suggestions. Obviously I want to make this generic so that in a subclass I can set the properties and have the same behavior except for the the BO and form used. Struggling with syntax.



Suggestions appreciated. TIA



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