I know about EventInfo.AddEventHandler(...)
method which can be used to attach handler to an event. But what should be done if i can not even define proper sign
I think your code is failing because the HandleRfqSendComment
is private. Instead you could directly create a delegate to that method, without passing its name to CreateDelegate
. You would then need to convert the delegate to the required type, using the following method :
public static Delegate ConvertDelegate(Delegate originalDelegate, Type targetDelegateType)
{
return Delegate.CreateDelegate(
targetDelegateType,
originalDelegate.Target,
originalDelegate.Method);
}
In your code, you could use this method as follows :
EventInfo eventInfo = rfqWindowManager.GetType().GetEvent("SendComment");
Action