You cannot “assign additional data” to a delegate, but you can create a parameterized version of the method form_Resizeand then use lambda expressions (in C # 3+) or anonymous delegates (C # 2+) to specify additional data when connecting a handler. One way to write this:
void form_Resize(object sender, EventArgs e, Data additional) {
// 'additional' contains whatever you specified when attaching handler
}
this.form.Resize += (s, e) => form_Resize(s, e, yourAdditionalData);
source
share