TryParseDocument() static private méthode

static private TryParseDocument ( string content, System.Xml.Linq.XDocument &document ) : bool
content string
document System.Xml.Linq.XDocument
Résultat bool
Exemple #1
0
        private static string ExtractMessageFromClientException(Exception exception)
        {
            DataServiceQueryException exception2 = exception as DataServiceQueryException;

            if ((exception2 != null) && (exception2.InnerException != null))
            {
                XDocument document;
                DataServiceClientException innerException = exception2.InnerException as DataServiceClientException;
                if ((exception2 != null) && (XmlUtility.TryParseDocument(innerException.Message, out document) && document.Root.Name.LocalName.Equals("error", StringComparison.OrdinalIgnoreCase)))
                {
                    return(document.Root.GetOptionalElementValue("message", null));
                }
            }
            return(null);
        }