protected bool OnXmlParseErrorOccurred(XElement aParentElement, XmlErrorTypes aErrorType, string aInformation) { if (XmlParseErrorOccurred != null) { var args = new XmlParseErrorOccurredEventArgs(aParentElement, aErrorType, aInformation); XmlParseErrorOccurred(this, args); return(args.Abort); } return(false); }
private void Importer_XmlParseErrorOccurred( object sender, XmlParseErrorOccurredEventArgs e ) { string message; if ( e.ErrorType == XmlErrorTypes.TagNotFound ) message = "Xml error occurred while trying to access the \"" + e.Information + "\" tag in \"" + e.Parent.Name + "\" element."; else if ( e.ErrorType == XmlErrorTypes.ValueParseError ) message = "Failed to parse value \"" + e.Information + "\" of \"" + e.Parent.Name + "\" element."; else message = e.Information; LogLine( "Error: " + message, MessageType.Error, false ); var action = (ErrorActions) Settings.Default.ActionOnError; if ( action == ErrorActions.Ask ) e.Abort = !ContinuableError( message ); else e.Abort = (action == ErrorActions.Abort); }