Inheritance

  • Thread starter Thread starter coco343
  • Start date Start date
C

coco343

Hello,
How can i call the parent function, in a child shared shadows
function ?
MyBase, MyClass and Me, are not allowed.

Here a exemple :

Public Class MyBaseClass

Public Shared Function MyFunction() As T
'code
End Function

End Class

Public Class MyChildClass
Inherits MyBaseClass

Public Shared Shadows Function MyFunction() As T
'here, how can i call the parent function ?
End Function

End Class
 
Hello,
How can i call the parent function, in a child shared shadows
function ?
MyBase, MyClass and Me, are not allowed.

Here a exemple :

Public Class MyBaseClass

Public Shared Function MyFunction() As T
'code
End Function

End Class

Public Class MyChildClass
Inherits MyBaseClass

Public Shared Shadows Function MyFunction() As T
'here, how can i call the parent function ?
End Function

End Class

MyBaseClass.MyFunction()

Shared (static in C#) members can't be overriden, so the method is
still going to be accessed just like it normally would be. IMO having
to specify "Shadows" on the shared method in the child class is just a
"do you know that you're shadowing and not overloading" message from
the compiler.

Thanks,

Seth Rowe
 
MyBaseClass.MyFunction()

Shared (static in C#) members can't be overriden, so the method is
still going to be accessed just like it normally would be. IMO having
to specify "Shadows" on the shared method in the child class is just a
"do you know that you're shadowing and not overloading" message from
the compiler.

Thanks,

Seth Rowe- Masquer le texte des messages précédents -

- Afficher le texte des messages précédents -

thanks :)

i though we can call it directly, as the child class inherits it.
i use shadows, because i can't use overrides ...
 
Since its a shared function you cannot call it with an instance variable.
Use syntax Mybaseclass.MyFunction.
Regards
Parag
 
Back
Top