private static string GetMessage(string message, string sourceUri, object sender, XmlSchemaObject sourceObj)
        {
            IXmlLineInfo xmlLineInfo = sender as IXmlLineInfo;

            if (xmlLineInfo == null)
            {
                return(XmlSchemaException.GetMessage(message, sourceUri, 0, 0, sourceObj));
            }
            return(XmlSchemaException.GetMessage(message, sourceUri, xmlLineInfo.LineNumber, xmlLineInfo.LinePosition, sourceObj));
        }
 /// <summary>Initializes a new instance of the <see cref="T:System.Xml.Schema.XmlSchemaException" /> class with the exception message and original <see cref="T:System.Exception" /> object that caused this exception specified.</summary>
 /// <param name="message">A string description of the error condition.</param>
 /// <param name="innerException">The original T:System.Exception object that caused this exception.</param>
 public XmlSchemaException(string message, Exception innerException) : base(XmlSchemaException.GetMessage(message, null, 0, 0, null), innerException)
 {
 }
 internal XmlSchemaException(string message, XmlSchemaObject sourceObject, Exception innerException) : base(XmlSchemaException.GetMessage(message, null, 0, 0, sourceObject), innerException)
 {
     this.hasLineInfo = true;
 }
        internal XmlSchemaException(string message, object sender, string sourceUri, XmlSchemaObject sourceObject, Exception innerException) : base(XmlSchemaException.GetMessage(message, sourceUri, sender, sourceObject), innerException)
        {
            IXmlLineInfo xmlLineInfo = sender as IXmlLineInfo;

            if (xmlLineInfo != null && xmlLineInfo.HasLineInfo())
            {
                this.hasLineInfo  = true;
                this.lineNumber   = xmlLineInfo.LineNumber;
                this.linePosition = xmlLineInfo.LinePosition;
            }
            this.sourceObj = sourceObject;
        }
 internal XmlSchemaException(string message, int lineNumber, int linePosition, XmlSchemaObject sourceObject, string sourceUri, Exception innerException) : base(XmlSchemaException.GetMessage(message, sourceUri, lineNumber, linePosition, sourceObject), innerException)
 {
     this.hasLineInfo  = true;
     this.lineNumber   = lineNumber;
     this.linePosition = linePosition;
     this.sourceObj    = sourceObject;
     this.sourceUri    = sourceUri;
 }