public void Run (object cmdTarget, CommandArrayInfo info)
{
if (customArrayHandlerChain != null) {
info.UpdateHandlerData = Method;
customArrayHandlerChain.CommandUpdate (cmdTarget, info);
} else {
if (Method == null)
throw new InvalidOperationException ("Invalid custom update handler. An implementation of ICommandArrayUpdateHandler was expected.");
if (!isArray)
throw new InvalidOperationException ("Invalid signature for command update handler: " + Method.DeclaringType + "." + Method.Name + "()");
DateTime t = DateTime.Now;
Method.Invoke (cmdTarget, new object[] {info} );
var time = DateTime.Now - t;
if (time.TotalMilliseconds > CommandManager.SlowCommandWarningTime)
LoggingService.LogWarning ("Slow command update ({0}ms): Command:{1}, Method:{2}", (int)time.TotalMilliseconds, CommandId, Method.DeclaringType + "." + Method.Name);
}
}
}