WPF c# outlook sendEventHandler with parameters

I´m creating a mail item and adding the sendEventHandler, what I need is to pass a list as parameter when calling the method inside the event.

My code:

private void method() { ... ((Microsoft.Office.Interop.Outlook.ItemEvents_10_Event)mailItem).Send += new Microsoft.Office.Interop.Outlook.ItemEvents_10_SendEventHandler(EmailEnviado); ... }

private void EmailEnviado(ref bool Cancel) { ... }

What I need is something like this:

private void method() { ... ((Microsoft.Office.Interop.Outlook.ItemEvents_10_Event)mailItem).Send += new Microsoft.Office.Interop.Outlook.ItemEvents_10_SendEventHandler(EmailEnviado( PARAMETER )); ... }

private void EmailEnviado(ref bool Cancel, PARAMETER ) { ... }

Thanks.


The number of parameters cannot be changed - the event handler signature is defined by the type library. What you can do however, is create a wrapper class that has all the parameters that you need as member properties. The event handler can be a method on that wrapper class.

链接地址: http://www.djcxy.com/p/21484.html

上一篇: 我如何设置一个编辑器来在Windows上使用Git?

下一篇: 带参数的WPF c#outlook sendEventHandler