Appccelerate.StateMachine.Machine.ActionHolders.ActionHoldersExceptionMessages.CannotCastArgumentToActionArgument C# (CSharp) Method

CannotCastArgumentToActionArgument() public static method

Cannot cast argument to action argument.
public static CannotCastArgumentToActionArgument ( object argument, string action ) : string
argument object The argument.
action string The action.
return string
        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);
        }
    }

Usage Example

        /// <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);
        }
All Usage Examples Of Appccelerate.StateMachine.Machine.ActionHolders.ActionHoldersExceptionMessages::CannotCastArgumentToActionArgument
ActionHoldersExceptionMessages