예제 #1
0
        public MethodInvocationInfo(string name, IEnumerable <MethodParameter> parameters, MethodParameter returnValue)
        {
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }
            if (parameters == null)
            {
                throw new ArgumentNullException("parameters");
            }
            this.methodName  = name;
            this.returnValue = returnValue;
            KeyedCollection <string, MethodParameter> keyeds = new MethodParametersCollection();

            foreach (MethodParameter parameter in parameters)
            {
                keyeds.Add(parameter);
            }
            this.parameters = keyeds;
        }
예제 #2
0
        /// <summary>
        /// Creates a new instance of MethodInvocationInfo.
        /// </summary>
        /// <param name="name">Name of the method to invoke.</param>
        /// <param name="parameters">Method parameters.</param>
        /// <param name="returnValue">Return value of the method (ok to pass <c>null</c> if the method doesn't return anything).</param>
        public MethodInvocationInfo(string name, IEnumerable <MethodParameter> parameters, MethodParameter returnValue)
        {
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }
            if (parameters == null)
            {
                throw new ArgumentNullException("parameters");
            }
            // returnValue can be null

            MethodName  = name;
            ReturnValue = returnValue;

            KeyedCollection <string, MethodParameter> mpk = new MethodParametersCollection();

            foreach (var parameter in parameters)
            {
                mpk.Add(parameter);
            }

            Parameters = mpk;
        }