Пример #1
0
        /// <summary>
        /// Throws a xml exception with line/column information if possible.
        /// </summary>
        /// <param name="message">The exception message. Must not be null or empty.</param>
        public void ThrowXmlException(string message)
        {
            if (String.IsNullOrWhiteSpace(message))
            {
                throw new ArgumentException(nameof(message));
            }
            IXmlLineInfo info = Element.GetLineColumnInfo();

            if (info.HasLineInfo())
            {
                throw new XmlException(message + info.GetLineColumnString(), null, info.LineNumber, info.LinePosition);
            }
            throw new XmlException(message);
        }