Esempio n. 1
0
        /// <summary>
        /// Extends ReadContentAs so that methods that return a specific type object given a Type parameter can be
        /// used as generic method and casting is not required.
        /// <example>
        /// xmlreader.ReadContentAs<int>(namespaceResolver);
        /// </example>
        /// </summary>
        public static T ReadContentAs <T>(this XmlNodeReader xmlreader, IXmlNamespaceResolver namespaceResolver)
        {
            if (xmlreader == null)
            {
                throw new ArgumentNullException("xmlreader");
            }

            return((T)xmlreader.ReadContentAs(typeof(T), namespaceResolver));
        }