EventArgs( ) in customEventArgs( )

  • Thread starter Thread starter Sujith Jagini
  • Start date Start date
S

Sujith Jagini

Hi,

When we create customEventArgs, we derive the classes from
eventArgs( ) and I dont understand the advantage of this inheritance.
This is neither an interface nor applied as attribute.

I have seen similar stuff in remoting also where we derive from
marshallByRef object in SAO to create transparent proxy. How it
creates transparent proxy just by inheriting from base class.?

If you know the reason, please let me know.

Thank You

Sujith
 
Sujith Jagini said:
When we create customEventArgs, we derive the classes from
eventArgs( ) and I dont understand the advantage of this inheritance.
This is neither an interface nor applied as attribute.

Consistency. It's similar how in order to throw a custom exception it has to
be a class derived from System.Exception. In the case of EventArgs there's
no rule however - you're more than free to define your own classes for your
custom events or functions.
I have seen similar stuff in remoting also where we derive from
marshallByRef object in SAO to create transparent proxy. How it
creates transparent proxy just by inheriting from base class.?

Because it inherits from a class that already contains all the necessary
functionality.
 
Back
Top