E
Eric Cadwell
What advantages do I reap by following the EventArgs pattern in defining
custom event delegates?
For example...
public delegate void CustomEventHandler(object sender, CustomEventArgs e);
public class CustomEventArgs : System.EventArgs
{
int index = 0;
public CustomEventArgs(int Index)
{
index = Index;
}
public int Index
{
get { return index; }
}
}
....instead of simply using...
public delegate void CustomEventHandler(int Index);
It's so much more work. There's a lot of boilerplate in writing events and
controls.
Thanks,
Eric
custom event delegates?
For example...
public delegate void CustomEventHandler(object sender, CustomEventArgs e);
public class CustomEventArgs : System.EventArgs
{
int index = 0;
public CustomEventArgs(int Index)
{
index = Index;
}
public int Index
{
get { return index; }
}
}
....instead of simply using...
public delegate void CustomEventHandler(int Index);
It's so much more work. There's a lot of boilerplate in writing events and
controls.
Thanks,
Eric