Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Strange this is. Probably I am doing something wrong. But I can't figure out, what.

 

Class BaseClass
 Public Sub LoadList (dvView as DataView) ...
End Class

 

Here comes what I wish I could do:

 

Class HeikosClass Inherits BaseClass
 Public Shadows Sub LoadList (dvView as DataView) ...
 Public Overloads Sub LoadList (dtTable as DataTable) ...
 Public Overloads Sub LoadList (myTablename as String) ...
End Class

 

The compiler won't allow that.

The second and third 'LoadList' must be declared shadows, because another Method with this name is declare shadows.

 

OK. However I can not declare them

Public Overloads Shadows Sub LoadList (myTablename as String) ...

 

(wouldn't make any sense in the first place) - the compiler complains again: Overloads and Shwdows can not be combined.

 

I am stuck.

 

Any help appreciated.

Tnx Heiko

.nerd
  • *Gurus*
Posted

I'm not entirely sure what you're trying to do, and why you need Shadows. Is it that the baseclass isn't written by you? If it is, you could do this:

 

Class BaseClass
   Public Overridable Sub LoadList(ByVal dvView As DataView)

   End Sub
End Class

Class HeikosClass
   Inherits BaseClass
   Public Overloads Overrides Sub LoadList(ByVal dvView As DataView)

   End Sub
   Public Overloads Sub LoadList(ByVal dtTable As DataTable)

   End Sub
   Public Overloads Sub LoadList(ByVal myTablename As String)

   End Sub
End Class

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

Posted

Yep.

It is not exactly written be me.

 

...

 

But by the guy sitting opposite to me :)

 

Thanks. What an obvious solution.

 

But I guess if I ever wanted to do this with a base class that is out of my reach, I'd be stranded, right?

.nerd

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...