Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Overload design when two different types of object
Message
From
05/09/2006 21:08:38
 
 
To
05/09/2006 21:02:56
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01151161
Message ID:
01151177
Views:
43
This message has been marked as the solution to the initial question of the thread.
>>Well, depending on which overload you use to instantiate your class, either oApp is Nothing or oProcess is Nothing. So, in your GetSchema method, you could check for that and if oApp is Nothing, use New Framework.Data(oProcess) and vice versa.
>
>Exact, but if the declaration is within a condition, the designer does like that very much. :)


I can get it to work ok in C# ... there's probably some way to get it to work in VB too. The trick in C# is to define it before the condition. So, I'd have something like this:
FrameWork.Data oFrame;
if (oApp == null)
    oFrame = new FrameWork.Data(oProcess);
else
    oFrame = new FrameWork.Data(oApp);
I'm sure there's a similar syntax in VB, isn't there?

~~Bonnie
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform