Exemplo n.º 1
0
        internal XPathFunctionInfo(MethodInfo method, XPathModuleInfo module)
        {
            if (method == null)
            {
                throw new ArgumentNullException("method");
            }
            if (method.ContainsGenericParameters)
            {
                throw new ArgumentException("Methods that accept type parameters cannot be used as module functions.", "method");
            }
            if (method.GetParameters().Any(p => p.IsOut))
            {
                throw new ArgumentException("Methods with out parmeters cannot be used as module functions.", "method");
            }
            if (module == null)
            {
                throw new ArgumentNullException("module");
            }

            this._Method = method;
            this._Module = module;

            if (this.Module.HasModuleAttribute)
            {
                this.functionAttr = Attribute.GetCustomAttribute(this.Method, typeof(XPathFunctionAttribute))
                                    as XPathFunctionAttribute;
            }
        }
Exemplo n.º 2
0
        internal XPathFunctionInfo(MethodInfo method, XPathModuleInfo module)
        {
            if (method == null) throw new ArgumentNullException("method");
             if (method.ContainsGenericParameters) throw new ArgumentException("Methods that accept type parameters cannot be used as module functions.", "method");
             if (method.GetParameters().Any(p => p.IsOut)) throw new ArgumentException("Methods with out parmeters cannot be used as module functions.", "method");
             if (module == null) throw new ArgumentNullException("module");

             this._Method = method;
             this._Module = module;

             if (this.Module.HasModuleAttribute) {

            this.functionAttr = Attribute.GetCustomAttribute(this.Method, typeof(XPathFunctionAttribute))
               as XPathFunctionAttribute;
             }
        }