Yes, the problem is, anything that excepts an icollection (like a grid or
something), will not be able to use the shadowed version.
Anyway, it seems like a stranger compiler and documentation bug - since
clearly this property is not overridable as the documentation claims.
Probably better off just implementing ICollection instead of inheriting
collectionbase at this point...
"Mick Doherty"
<EX***********@AND.REMOVE.SQUAREBRACKETS.[mdaudi100#ntlworld.com]> wrote in
message news:On**************@TK2MSFTNGP10.phx.gbl...
Your right. It should be either/or not both.
In any case you can shadow it.
Public Shadows ReadOnly Property Count() As Integer
Get
Set
End Property
--
Mick Doherty
http://dotnetrix.co.uk
"Marina" <so*****@nospam.com> wrote in message
news:u0**************@TK2MSFTNGP09.phx.gbl... Hi,
I have a class that inherits from CollectionBase, and I'm trying to
override its Count property. As per the documentation, this property is
overridable - so I should be able to do this. So this is my code:
Public Overrides ReadOnly Property Count() As Integer
Get
End Get
End Property
The message I am getting is:
'Public Overrides ReadOnly Property Count() As Integer' cannot override
'Public Overridable NotOverridable ReadOnly Property Count() As Integer'
because it is declared 'NotOverridable'.
According to this, Count is both Overridable and NotOverridable? And
the NotOverridable is winning?
Can anyone shed any light on this?
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.701 / Virus Database: 458 - Release Date: 07/06/2004