C
C-Sharper or C-Hasher, one of the two
Hi,
I have a C# class libary (Class1) which is inherited by another class in a
Windows Forms app. I want this other class to implement some, but not all of
the features of the base class. How can I completely hide (within the IDE)
the members of the base class library i.e. only expose those members that I
want exposed? I've tried some methods gleaned by googling for "hiding base
class members" which suggested using things like "new" and a blank function
structure but this doesn't apparently work. The only idea I've come up with
is not to inherit the base class but simply create an instance of it and use
that instead and then create only the methods and properties that I need in
my derived class. This at the moment seems to be the most logical solution,
but it also seems like a lot of extra work, does anyone know of a better
way. I basically want it to work like using interfaces, you know, expose and
hide what you want as appropriate.
Thanks
Greg
I have a C# class libary (Class1) which is inherited by another class in a
Windows Forms app. I want this other class to implement some, but not all of
the features of the base class. How can I completely hide (within the IDE)
the members of the base class library i.e. only expose those members that I
want exposed? I've tried some methods gleaned by googling for "hiding base
class members" which suggested using things like "new" and a blank function
structure but this doesn't apparently work. The only idea I've come up with
is not to inherit the base class but simply create an instance of it and use
that instead and then create only the methods and properties that I need in
my derived class. This at the moment seems to be the most logical solution,
but it also seems like a lot of extra work, does anyone know of a better
way. I basically want it to work like using interfaces, you know, expose and
hide what you want as appropriate.
Thanks
Greg