private ReportException ( Exception x, XmlNode node ) : void | ||
x | Exception | |
node | XmlNode | |
return | void |
internal static XamlDocument Parse(XmlDocument document, XamlParserSettings settings) { if (document == null) { throw new ArgumentNullException("document"); } if (settings == null) { throw new ArgumentNullException("settings"); } XamlParser p = new XamlParser(); p.settings = settings; p.errorSink = (IXamlErrorSink)settings.ServiceProvider.GetService(typeof(IXamlErrorSink)); p.document = new XamlDocument(document, settings); try { var root = p.ParseObject(document.DocumentElement); p.document.ParseComplete(root); } catch (Exception x) { p.ReportException(x, document.DocumentElement); } return(p.document); }
internal static XamlDocument Parse(XmlDocument document, XamlParserSettings settings) { if (document == null) throw new ArgumentNullException("document"); if (settings == null) throw new ArgumentNullException("settings"); XamlParser p = new XamlParser(); p.settings = settings; p.errorSink = (IXamlErrorSink)settings.ServiceProvider.GetService(typeof(IXamlErrorSink)); p.document = new XamlDocument(document, settings); try { var root = p.ParseObject(document.DocumentElement); p.document.ParseComplete(root); } catch (Exception x) { p.ReportException(x, p.currentParsedNode); } return p.document; }