System.Xml.XmlException.XmlException C# (CSharp) Méthode

XmlException() protected méthode

protected XmlException ( SerializationInfo info, StreamingContext context ) : System
info SerializationInfo
context StreamingContext
Résultat System
        protected XmlException(SerializationInfo info, StreamingContext context) : base(info, context) {
            _res                 = (string)  info.GetValue("_res"  , typeof(string));
            _args                = (string[])info.GetValue("_args", typeof(string[]));
            _lineNumber          = (int)     info.GetValue("_lineNumber", typeof(int));
            _linePosition        = (int)     info.GetValue("_linePosition", typeof(int));

            // deserialize optional members
            _sourceUri = string.Empty;
            string version = null;
            foreach ( SerializationEntry e in info ) {
                switch ( e.Name ) {
                    case "sourceUri":
                        _sourceUri = (string)e.Value;
                        break;
                    case "version":
                        version = (string)e.Value;
                        break;
                }
            }

            if ( version == null ) {
                // deserializing V1 exception
                _message = CreateMessage( _res, _args, _lineNumber, _linePosition );
            }
            else {
                // deserializing V2 or higher exception -> exception message is serialized by the base class (Exception._message)
                _message = null;
            }
        }

Same methods

XmlException::XmlException ( ) : System
XmlException::XmlException ( String message ) : System
XmlException::XmlException ( String message, Exception innerException ) : System
XmlException::XmlException ( String message, Exception innerException, int lineNumber, int linePosition ) : System
XmlException::XmlException ( String message, Exception innerException, int lineNumber, int linePosition, string sourceUri ) : System
XmlException::XmlException ( string res, String arg, Exception innerException, IXmlLineInfo lineInfo ) : System
XmlException::XmlException ( string res, String arg, IXmlLineInfo lineInfo ) : System
XmlException::XmlException ( string res, String arg, IXmlLineInfo lineInfo, string sourceUri ) : System
XmlException::XmlException ( string res, int lineNumber, int linePosition ) : System
XmlException::XmlException ( string res, string args ) : System
XmlException::XmlException ( string res, string args, Exception innerException, int lineNumber, int linePosition ) : System
XmlException::XmlException ( string res, string args, Exception innerException, int lineNumber, int linePosition, string sourceUri ) : System
XmlException::XmlException ( string res, string args, IXmlLineInfo lineInfo ) : System
XmlException::XmlException ( string res, string args, IXmlLineInfo lineInfo, string sourceUri ) : System
XmlException::XmlException ( string res, string arg, int lineNumber, int linePosition ) : System
XmlException::XmlException ( string res, string arg, int lineNumber, int linePosition, string sourceUri ) : System
XmlException::XmlException ( string res, string args, string sourceUri ) : System