Esempio n. 1
0
        /// <summary>
        /// Returns the <see cref="OpenXmlPart" />'s root element <see cref="XNamespace" />.
        /// </summary>
        /// <param name="part">The part.</param>
        /// <returns>The namespace.</returns>
        public static XNamespace GetRootNamespace(this OpenXmlPart part)
        {
            if (part == null)
            {
                throw new ArgumentNullException("part");
            }

            var root = part.GetRootElement();

            return(root != null ? root.Name.Namespace : null);
        }