JaedenRuiner
Well-known member
- Joined
- Aug 13, 2007
- Messages
- 340
- Programming Experience
- 10+
Okay,
I am just curious if there is anyway to truly override the visibility scope of a property/method of an inherited class. For Example:
This in and of itself does not work, for the x variable defined in Form1 class, is able to see both the add() methods. i want to completely hide the inherited add() method so that the only visible one is the one that I choose in my implementation of the inherited class...if it's possible.
Thanks
Jaeden "Sifo Dyas" al'Raec Ruiner
I am just curious if there is anyway to truly override the visibility scope of a property/method of an inherited class. For Example:
VB.NET:
Class1.vb
---------
public class Class1
public sub Add(item as TItem)
end sub
end class
Class2.vb
---------
public class Class2
protected shadows sub Add(item as TItem)
mybase.add(item)
end sub
public shadows sub add(item as TData)
dim t as new TItem(item)
add(t)
end sub
end class
Form1.vb
---------
dim x as new class2()
x.add -> should only allow adding of TData, not TItem
This in and of itself does not work, for the x variable defined in Form1 class, is able to see both the add() methods. i want to completely hide the inherited add() method so that the only visible one is the one that I choose in my implementation of the inherited class...if it's possible.
Thanks
Jaeden "Sifo Dyas" al'Raec Ruiner