4
4Space
Am I losing my mind?
I'm creating a strongly typed collection derived from CollectionBase,
like yay:
public class TestCol : CollectionBase
{
public override IEnumerator GetEnumerator()
{
return null;
}
}
I've done this a thousand times before so I'm sure I'm doing something
very silly. This gets an error:
C:\Temp\WindowsControlLibrary1\WindowsControlLibrary1\TestCol.cs(18):
'WindowsControlLibrary1.TestCol.GetEnumerator()' : cannot override
inherited member 'System.Collections.CollectionBase.GetEnumerator()'
because it is not marked virtual, abstract, or override
Now the MSDN docs say that it is virtual:
public virtual IEnumerator GetEnumerator();
so what am I missing? Aside from a few marbles.
Cheers,
4Space
I'm creating a strongly typed collection derived from CollectionBase,
like yay:
public class TestCol : CollectionBase
{
public override IEnumerator GetEnumerator()
{
return null;
}
}
I've done this a thousand times before so I'm sure I'm doing something
very silly. This gets an error:
C:\Temp\WindowsControlLibrary1\WindowsControlLibrary1\TestCol.cs(18):
'WindowsControlLibrary1.TestCol.GetEnumerator()' : cannot override
inherited member 'System.Collections.CollectionBase.GetEnumerator()'
because it is not marked virtual, abstract, or override
Now the MSDN docs say that it is virtual:
public virtual IEnumerator GetEnumerator();
so what am I missing? Aside from a few marbles.
Cheers,
4Space