public static string CannotCastArgumentToActionArgument(object argument, string action) { return string.Format( CultureInfo.InvariantCulture, "Cannot cast argument to match action method. Argument = {0}, Action = {1}", argument, action); } }
/// <summary> /// Executes the transition action. /// </summary> /// <param name="argument">The state machine event argument.</param> public void Execute(object argument) { if (argument != null && !(argument is T)) { throw new ArgumentException(ActionHoldersExceptionMessages.CannotCastArgumentToActionArgument(argument, this.Describe())); } this.action((T)argument); }