summaryrefslogtreecommitdiff
path: root/src/mscorlib/src/System/Security/XMLSyntaxException.cs
blob: 1e4441412f5b804503c325d2575bdf0f6c945b70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

// 

namespace System.Security {
    using System;
    using System.Runtime.Serialization;
    using System.Globalization;

    [System.Runtime.InteropServices.ComVisible(true)]
    [Serializable] sealed public class XmlSyntaxException : SystemException
    {
        public
        XmlSyntaxException ()
            : base (Environment.GetResourceString( "XMLSyntax_InvalidSyntax" ))
        {
            SetErrorCode(__HResults.CORSEC_E_XMLSYNTAX);
        }

        public
        XmlSyntaxException (String message)
            : base (message)
        {
            SetErrorCode(__HResults.CORSEC_E_XMLSYNTAX);
        }

        public
        XmlSyntaxException (String message, Exception inner)
            : base (message, inner)
        {
            SetErrorCode(__HResults.CORSEC_E_XMLSYNTAX);
        }

        public
        XmlSyntaxException (int lineNumber)
            : base (String.Format( CultureInfo.CurrentCulture, Environment.GetResourceString( "XMLSyntax_SyntaxError" ), lineNumber ) )
        {
            SetErrorCode(__HResults.CORSEC_E_XMLSYNTAX);
        }

        public
        XmlSyntaxException( int lineNumber, String message )
            : base( String.Format( CultureInfo.CurrentCulture, Environment.GetResourceString( "XMLSyntax_SyntaxErrorEx" ), lineNumber, message ) )
        {
            SetErrorCode(__HResults.CORSEC_E_XMLSYNTAX);
        }

        internal XmlSyntaxException(SerializationInfo info, StreamingContext context) : base(info, context)
        {
        }
    }
}