internal virtual void OnUnknownNode(XmlNodeEventArgs e) { if (onUnknownNode != null) { onUnknownNode(this, e); } }
string NodeNameOf(XmlNodeEventArgs e) { switch (e.NodeType) { case XmlNodeType.Element: return "<" + e.LocalName + " xmlns=\"" + e.NamespaceURI + "\">"; case XmlNodeType.Attribute: return "attribute: " + e.LocalName; case XmlNodeType.Text: return "text: " + e.Text; case XmlNodeType.CDATA: return "CDATA"; case XmlNodeType.ProcessingInstruction: return "<?"; case XmlNodeType.Comment: return "<!-- " + e.Text + " -->"; default: throw new InvalidOperationException(Res.GetString(Res.ErrUnknownNodeType)); } }
// handlers for problems loading XML files private static void serializer_UnknownNode(object sender, XmlNodeEventArgs e) { Console.WriteLine("Unknown node:\t" + e.Name + "\t" + e.Text); }
void mySerializer_UnknownNode(object sender, XmlNodeEventArgs e) { ShowXmlParserError(); }
internal virtual void OnUnknownNode (XmlNodeEventArgs e) { if (onUnknownNode != null) onUnknownNode(this, e); }
private static void XmlParseErrorOnNode(object sender, XmlNodeEventArgs e) { throw new XmlException("Error on node " + e.NodeType + "(" + e.Text + ") at " + e.LineNumber + "," + e.LinePosition); }
protected void SerializerUnknownNode(object sender, XmlNodeEventArgs e) { Console.WriteLine("Unknown Node:" + e.Name + "\t" + e.Text); }
void OnUnknownNode(object sender, XmlNodeEventArgs e) { if (e.NodeType != XmlNodeType.Comment) Console.WriteLine(Res.GetString(Res.Warning, Res.GetString(Res.UnhandledNode, e.LineNumber, e.LinePosition, NodeNameOf(e)))); }
/// <summary> /// Fault handling for reading an unknown node from the specified Xml file /// </summary> private static void Serializer_UnknownNode(object sender, XmlNodeEventArgs e) { MessageBox.Show(String.Format("Unknown Node: {0} \t {1}", e.Name, e.Text), "Error reading file", MessageBoxButton.OK, MessageBoxImage.Error); }
private static void serializer_UnknownNode(object sender, XmlNodeEventArgs e) { Console.WriteLine("Unknown node {0} at line {1}, col {2}", e.Name, e.LineNumber, e.LinePosition); }
private static void serializer_UnknownNode(object sender, XmlNodeEventArgs e) { Tracer.ErrorFormat("Unknown Node: {0}\t{1}", e.Name, e.Text); }
void schemaSerializer_UnknownNode(object sender, XmlNodeEventArgs e) { this.loadError.Add("Unkonwn node (" + e.LineNumber + ", " + e.LinePosition + "): " + e.Name); }
private void UnknownNode(XmlNode unknownNode, object o, string qnames) { if (unknownNode != null) { if (((unknownNode.NodeType != XmlNodeType.None) && (unknownNode.NodeType != XmlNodeType.Whitespace)) && (this.events.OnUnknownNode != null)) { int num; int num2; this.GetCurrentPosition(out num, out num2); XmlNodeEventArgs e = new XmlNodeEventArgs(unknownNode, num, num2, o); this.events.OnUnknownNode(this.events.sender, e); } if (unknownNode.NodeType == XmlNodeType.Attribute) { this.UnknownAttribute(o, (XmlAttribute) unknownNode, qnames); } else if (unknownNode.NodeType == XmlNodeType.Element) { this.UnknownElement(o, (XmlElement) unknownNode, qnames); } } }
void OnUnknownNode(object obj, XmlNodeEventArgs args) { // Breakpoint here and look at the args class Console.WriteLine(args.Name); }
private void serializer_UnknownNode(object sender, XmlNodeEventArgs e) { if (!string.IsNullOrEmpty(e.Text)) { Logger.Error("Unknown Node {0}", e.Name); } }
/// <summary> /// <see cref="XmlSerializer.UnknownNode"/> event handler for /// the <see cref="XmlSerializer"/>, that raises /// a error message box when getting an unknown node in the /// xml settings file. /// </summary> /// <param name="sender"> /// Source of the event. /// </param> /// <param name="e"> /// A <see cref="XmlNodeEventArgs"/> that contains the event data. /// </param> protected void SerializerUnknownNode(object sender, XmlNodeEventArgs e) { string message = "Unknown Node:" + e.Name + "\t" + e.Text + Environment.NewLine + " in tracker settings file." + Environment.NewLine + "I try to ignore it."; InformationDialog.Show("XML error", message, false, MessageBoxIcon.Information); }
/// <summary> /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed. /// <example> /// xmlnodeeventhandler.BeginInvoke(sender, e, callback); /// </example> /// </summary> public static IAsyncResult BeginInvoke(this XmlNodeEventHandler xmlnodeeventhandler, Object sender, XmlNodeEventArgs e, AsyncCallback callback) { if(xmlnodeeventhandler == null) throw new ArgumentNullException("xmlnodeeventhandler"); return xmlnodeeventhandler.BeginInvoke(sender, e, callback, null); }
private static void serializer_UnknownNode(object sender, XmlNodeEventArgs e) { #if DEBUG Program.debugStream.WriteLine("Unknown Node:" + e.Name + "\t" + e.Text); #endif }
protected void XmlSerializer_UnknownNode( object sender, XmlNodeEventArgs e ) { }
private static void UnknownNode(object sender, XmlNodeEventArgs e) { Debug.Log("unknown node " + sender.ToString() + " " + e.ToString()); }
private void OnUnknownNode(object sender, XmlNodeEventArgs e) { Console.Out.WriteLine("Template Serializer. Unknown node is encountered in the tempalte: " + e.Text); }
private void Serializer_UnknownNode(object sender, XmlNodeEventArgs e) { P p = e.ObjectBeingDeserialized as P; if (p != null) { if (p.Text == null) p.Text = string.Empty; if (e.Name == "#text") p.Text += e.Text; } }
static protected void DeserializeUnknownNode(object sender, XmlNodeEventArgs e) { // MessageBox.Show("Ignoring Unknown Node from settings file: " + e.Name); }
public void unknownNode(object sender, XmlNodeEventArgs e) { String msg = String.Format("unknown Node: {2} vom Typ {3} in Zeile {0} Pos {1}", e.LineNumber, e.LinePosition, e.Name, e.NodeType); show(msg); Console.WriteLine(msg); }
protected void OnUnknownNode(object sender, XmlNodeEventArgs e) { Trace.WriteLine("Unknown Node:" + e.Name + "\t" + e.Text); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void serializer_UnknownNode(object sender, XmlNodeEventArgs e) { //string s = "Unknown Node:" + e.Name + "\t" + e.Text; }
void CDataTextNodes_BadNode (object s, XmlNodeEventArgs e) { Assert.Fail (); }
private static void xs_UnknownNode(object sender, XmlNodeEventArgs e) { // we don't care about unknown nodes }
void UnknownNode(XmlNode unknownNode, object o, string qnames) { if (unknownNode == null) return; if (unknownNode.NodeType != XmlNodeType.None && unknownNode.NodeType != XmlNodeType.Whitespace && events.OnUnknownNode != null) { int lineNumber, linePosition; GetCurrentPosition(out lineNumber, out linePosition); XmlNodeEventArgs e = new XmlNodeEventArgs(unknownNode, lineNumber, linePosition, o); events.OnUnknownNode(events.sender, e); } if (unknownNode.NodeType == XmlNodeType.Attribute) { UnknownAttribute(o, (XmlAttribute)unknownNode, qnames); } else if (unknownNode.NodeType == XmlNodeType.Element) { UnknownElement(o, (XmlElement)unknownNode, qnames); } }
/// <summary> /// Handles the UnknownNode event of the serializer control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.Xml.Serialization.XmlNodeEventArgs"/> instance containing the event data.</param> private void serializer_UnknownNode( object sender, XmlNodeEventArgs e ) { _errorText += String.Format( "unknown node {0}='{1}'", e.Name, e.Text ); }
private void OnUnknownNode(object sender, XmlNodeEventArgs e) { // TODO: should be handled as an exception to the user Logger.Fail ("Unknown Node:" + e.Name + "\t" + e.Text); }
static private void serializer_UnknownNode (object sender, System.Xml.Serialization.XmlNodeEventArgs e) { MessageLogger.Add(string.Format("Error in xml settings file - unknown Node: {0} \t {1}", e.Name, e.Text), MessageLogger.MsgLevel.error); }