Exemplo n.º 1
0
        public MethodInvokeExpression(
			MethodReferenceExpression method,
			params Expression[] parameters
			)
        {
            if (method==null)
                throw new ArgumentNullException("method");
            this.invokedMethod = method;
            this.parameters.AddRange(parameters);
        }
Exemplo n.º 2
0
        public DelegateCreateExpression(ITypeDeclaration delegateType, 
			MethodReferenceExpression targetMethod)
        {
            if (delegateType==null)
                throw new ArgumentNullException("delegateType");
            if (targetMethod==null)
                throw new ArgumentNullException("targetMethod");

            this.delegateType = delegateType;
            this.targetMethod = targetMethod;
        }
Exemplo n.º 3
0
 public MethodInvokeExpression(
     MethodReferenceExpression method,
     params Expression[] parameters
     )
 {
     if (method == null)
     {
         throw new ArgumentNullException("method");
     }
     this.invokedMethod = method;
     this.parameters.AddRange(parameters);
 }
Exemplo n.º 4
0
        public DelegateCreateExpression(ITypeDeclaration delegateType,
                                        MethodReferenceExpression targetMethod)
        {
            if (delegateType == null)
            {
                throw new ArgumentNullException("delegateType");
            }
            if (targetMethod == null)
            {
                throw new ArgumentNullException("targetMethod");
            }

            this.delegateType = delegateType;
            this.targetMethod = targetMethod;
        }
Exemplo n.º 5
0
        /// <summary>
        /// Creates a delegate constructr
        /// </summary>
        /// <param name="delegateType">
        /// The delegate type
        /// </param>
        /// <param name="method">
        /// The listener method
        /// </param>
        /// <returns>
        /// A <see cref="DelegateCreateExpression"/> representing the
        /// delegate creation.
        /// </returns>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="delegateType"/> or <paramref name="method"/>
        /// is a null reference (Nothing in Visual Basic)
        /// </exception>
        public static DelegateCreateExpression Delegate(
			Type delegateType,
			MethodReferenceExpression method)
        {
            if (delegateType==null)
                throw new ArgumentNullException("delegateType");
            if (method==null)
                throw new ArgumentNullException("method");
            return new DelegateCreateExpression(new TypeTypeDeclaration(delegateType),method);
        }