/// <summary> /// Invokes this object. /// </summary> /// <param name="invocation">The invocation.</param> void IAction.Invoke(Invocation invocation) { var eventHandler = invocation.Parameters[0] as Delegate; if (eventHandler != null) { invoker.Initialize(eventHandler); return; } throw new ArgumentNullException(string.Concat(@"invocation.", @"Parameters[0]"), string.Format("Event handler parameter is of the wrong type: {0}. EventHandler type expected.", invocation.Parameters[0].GetType())); }