using System;
namespace Wayne.Lib
{
///
/// A generic event args holding an argument of some type.
///
/// The event argument.
public class EventArgs : EventArgs
{
#region Fields
private T argument;
#endregion
#region Construction
///
/// Construction.
///
/// The event argument.
public EventArgs(T argument)
{
this.argument = argument;
}
#endregion
#region Properties
///
/// The event argument.
///
public T Argument
{
get { return argument; }
}
#endregion
#region Debug methods
///
/// Presents the class as a string.
///
///
public override string ToString()
{
return string.Format(System.Globalization.CultureInfo.InvariantCulture,
"EventArgs<{0}>({1})", argument.GetType().Name, argument);
}
#endregion
}
///
/// A generic event args holding an argument of some type.
///
/// The event argument.
/// The event sender.
public class EventArgs : EventArgs
{
///
/// Construction.
///
/// The sender
/// The event argument.
public EventArgs(TSender sender, TArgument argument)
{
Sender = sender;
Argument = argument;
}
///
/// The event argument.
///
public TArgument Argument { get; private set; }
///
/// The event sender.
///
public TSender Sender { get; private set; }
///
/// Presents the class as a string.
///
///
public override string ToString()
{
return string.Format(System.Globalization.CultureInfo.InvariantCulture,
"EventArgs<{0},{1}>({2}, {3})", Sender.GetType().Name, Argument.GetType().Name, Sender, Argument);
}
}
}