EventArgs Class

Overview

  • Defines the arguments to pass in an event.
  • The EventArgs class is used to raise an event without any data.

Good practice

  • Always use a class to pass event data via a delegate instead of defining separate parameters for each piece of event data.

Examples

Custom Event Arguments

public class MyEventArgs : EventArgs
{
    private string _someData;
 
    public MyEventArgs(string someEventData)
    {
        this._someData = someEventData;
    }
}
 
learning/exam70-536/eventargs.txt · Last modified: 2008/08/26 11:52 by david
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki