M
MikeP
Hi there,
I wrote a replacement for the native .NET class "FileDialog" with my own
"FileOk" event (triggered when the user selects a file and clicks OK). Let's
say I now want to create a derivative called "MyFileDialog" and replace the
"FileOk" event with a new event called "MyFileOk". Users of this class
should therefore rely on the latter event and not "FileOk" from the base
class. Is it therefore possible to hide the base class' "FileOk" event so
that users can't invoke it. Redefining it as private doesn't help (the base
class version kicks in instead) so the only way I can see is to redefine it
as "public" (using the "new" keyword) and then throwing a
"System.NotImplementedException" (also asserting in the debug version). This
is ugly IMO however so I'm hoping there's a cleaner way. Any advice would be
appreciated. Thanks.
I wrote a replacement for the native .NET class "FileDialog" with my own
"FileOk" event (triggered when the user selects a file and clicks OK). Let's
say I now want to create a derivative called "MyFileDialog" and replace the
"FileOk" event with a new event called "MyFileOk". Users of this class
should therefore rely on the latter event and not "FileOk" from the base
class. Is it therefore possible to hide the base class' "FileOk" event so
that users can't invoke it. Redefining it as private doesn't help (the base
class version kicks in instead) so the only way I can see is to redefine it
as "public" (using the "new" keyword) and then throwing a
"System.NotImplementedException" (also asserting in the debug version). This
is ugly IMO however so I'm hoping there's a cleaner way. Any advice would be
appreciated. Thanks.
