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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top