The code
/// <summary>
/// This is the definition for a generic eventargs class with one
/// parameter.
/// </summary>
public class ParameterEventArgs<T> : EventArgs
{
#region Constructor
/// <summary>
/// Constructor...
/// </summary>
/// <param name="parameter">The parameter to pass.</param>
public ParameterEventArgs(T parameter)
{
_parameter = parameter;
}
#endregion
#region Properties
/// <summary>
/// Gets the parameter from the event arguments.
/// </summary>
public T Parameter
{
get
{
return _parameter;
}
}
#endregion
#region Fields
private T _parameter;
#endregion
}
Using itpublic event EventHandler<ParameterEventArgs<int>> EventWhichPassesAnInt;
public event EventHandler<ParameterEventArgs<CustomClass>> EventWhichPassesACustomClass;
No comments:
Post a Comment