public new event...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Michael Mayer

    #1

    public new event...

    I continually get the following warning from the C# compiler:

    The keyword new is required on
    'MyNameSpace.Ta bulatedDataTabl e.ColumnChangin g' because it hides
    inherited member 'System.Data.Da taTable.ColumnC hanging'

    From this line of code:
    public new event DataColumnChang eEventHandler ColumnChanging;

    I'm trying to declare a "new" event that hides an event from a base
    class. The base class is DataTable and I want to create a new
    ColumnChanging event that only fires for certain types of Column
    Changes (or more precisely, it ignores certain column changes from
    sources that shouldn't fire an event in my app).

    The C# spec says that public & new are valid event-modifiers and
    should precede the keyword event.
    It compiles fine, I just want to get rid of the warning. Am I doing
    something wrong? Or is that warning always there?

    I'm using .net ver 1.0

    Thanks in advance,
    Mike




Working...