I have a ContextMenuStrip control that allows you to perform an action, these are two different options: Syncand Async.
I am trying to cover everything using Generics, so I did this:
public class BaseContextMenu<T> : IContextMenu
{
private T executor;
public void Exec(Action<T> action)
{
action.Invoke(this.executor);
}
public void ExecAsync(Action<T> asyncAction)
{
}
How can I write an async method to perform a common action and “do something” with the menu at the same time? I saw that the signature BeginInvokelooks something like this:
asyncAction.BeginInvoke(this.executor, IAsyncCallback, object);
source
share