Re: Overriding Hashtable.Add method

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Ken Tucker [MVP] (vb2ae_at_bellsouth.net)
Date: 09/20/04


Date: Mon, 20 Sep 2004 16:31:26 -0400

Hi,

            To create a custom collection you inherit from collectionbase.
To create a custom hastable inherit from DictionaryBase.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemcollectionsdictionarybaseclasstopic.asp

Ken
---------------
"John Cobb" <john.cobb@acxiom.com> wrote in message
news:OXIaDv0nEHA.3876@TK2MSFTNGP15.phx.gbl...
MSDN and intellisense shows the Add method of Hashtable being overridable
however when I use this code:

Public Class RAL
Inherits Hashtable

Public Overrides Sub Add(ByVal Key As String, ByVal Value As Object)

End Sub

 I get the following 2 errors indicating that Add is Overloadable instead of
Overridable:

sub 'Add' cannot be declared 'Overrides' because it does not override a sub
in a base class.

sub 'Add' shadows an overloadable member declared in the base class
'Hashtable'. If you want to overload the base method, this method must be
declared 'Overloads'.

If possible I need to override this. Any suggestions appreciated.
Thanks,
John



Relevant Pages

  • Re: Overriding Hashtable.Add method
    ... Class dropdown box above the text editor and then "Add" from the other ... > Public Overrides Sub Add ... If you want to overload the base method, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Overriding Hashtable.Add method
    ... more robust object. ... > Public Overrides Sub Add ... If you want to overload the base method, ...
    (microsoft.public.dotnet.languages.vb)
  • RE: Windows Service app to access network
    ... Unless overridden, windows ... This system account might have no access to the share. ... Public Sub New ... Protected Overloads Overrides Sub Dispose ...
    (microsoft.public.dotnet.general)
  • Re: Overriding Hashtable.Add method
    ... Rather then attempt to inherit from Hashtable, ... > Public Overrides Sub Add ... If you want to overload the base method, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Exposing ListItems in Composite Control
    ... End Sub ... > from a listbox control use the following code and ignore the code in the ... > Public Overrides Sub RenderBeginTag(ByVal writer As ... > All you need to do is override the RenderBeginTag and RenderEndTags ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)