Example #1
0
    protected override string Execute(string[] InArguments)
    {
        if (this.argumentsTypes == null || this.argumentsTypes.Length == 0)
        {
            return(this.Method.Invoke(null, null) as string);
        }
        object[] array = new object[this.argumentsTypes.Length];
        for (int i = 0; i < array.Length; i++)
        {
            IArgumentDescription description = Singleton <ArgumentDescriptionRepository> .instance.GetDescription(this.argumentsTypes[i].argumentType);

            DebugHelper.Assert(description != null);
            array[i] = description.Convert(InArguments[i], this.argumentsTypes[i].argumentType);
        }
        return(this.Method.Invoke(null, array) as string);
    }
        protected override string Execute(string[] InArguments)
        {
            if (argumentsTypes == null || argumentsTypes.Length == 0)
            {
                return(Method.Invoke(null, null) as string);
            }
            else
            {
                object[] Parameters = new object[argumentsTypes.Length];

                for (int i = 0; i < Parameters.Length; ++i)
                {
                    IArgumentDescription ArgDescInterface = ArgumentDescriptionRepository.instance.GetDescription(argumentsTypes[i].argumentType);

                    DebugHelper.Assert(ArgDescInterface != null);

                    Parameters[i] = ArgDescInterface.Convert(InArguments[i], argumentsTypes[i].argumentType);
                }

                return(Method.Invoke(null, Parameters) as string);
            }
        }