Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing parameters
Message
From
17/03/2004 11:09:17
Jason Mesches
Ocean Systems Engineering Corporation
Carlsbad, California, United States
 
 
To
17/03/2004 00:17:57
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
00886959
Message ID:
00887102
Views:
17
Hello Alan,

If the various BizObjs share similar behavior, you can have them implement an interface containing the common methods and then cast the result of GetBizObj():
IYourInterface yourBORef = (IYourInterface)YourForm.GetBizObj("YourBizObj");

//At runtime, here you'll be running the subclass version of the interface method.
yourBORef.YourInterfaceMethod()
Hope that helps,
---J

>Hello All,
>
>I have created a custom search control that I have placed on several forms. One of the properties of the control is a reference to the primary business object on the form. I have a RegisterBizobj method on my control that accepts a paramter of type ABusinessObject. But what I'm really passing is a subclass of ABusinessObject (a different class on each form). If I cast the parameter as ABusinessObject, I can't access any of the methods that are on my subclasses. Is there any way to get around this strict typing problem?
>
>Thanks
>Alan Jefferson
Previous
Reply
Map
View

Click here to load this message in the networking platform