Inheritance: System.EventArgs
        void UnknownElement(object o, XmlElement elem, string qnames)
        {
            int line_number, line_position;

            if (Reader is XmlTextReader)
            {
                line_number   = ((XmlTextReader)Reader).LineNumber;
                line_position = ((XmlTextReader)Reader).LinePosition;
            }
            else
            {
                line_number   = 0;
                line_position = 0;
            }

            XmlElementEventArgs args = new XmlElementEventArgs(elem, line_number, line_position, o);

#if NET_2_0
            args.ExpectedElements = qnames;
#endif

            if (eventSource != null)
            {
                eventSource.OnUnknownElement(args);
            }
        }
Example #2
0
 internal virtual void OnUnknownElement(XmlElementEventArgs e)
 {
     if (onUnknownElement != null)
     {
         onUnknownElement(this, e);
     }
 }
 internal static void OnUnknownElement(object sender, XmlElementEventArgs e) {
     if (e.Element == null)
         return;
     string xml = RuntimeUtils.ElementString(e.Element);
     Tracing.OnUnknownElement(sender, e);
     if (e.ExpectedElements == null)
         throw new InvalidOperationException(Res.GetString(Res.WebUnknownElement, xml));
     else if (e.ExpectedElements.Length == 0)
         throw new InvalidOperationException(Res.GetString(Res.WebUnknownElement1, xml));
     else
         throw new InvalidOperationException(Res.GetString(Res.WebUnknownElement2, xml, e.ExpectedElements));
 }
        // handles elements tagged as Obsolete which are otherwise ignored by the Xml Serializer
        public static void serializer_UnknownElement(object sender, XmlElementEventArgs e)
        {
            if (e.Element.Name != "ProductCodeId")
                return;

            var target = e.ObjectBeingDeserialized as Image;
            if (target == null)
                return;

            #pragma warning disable 0618
            target.ProductCode.Add(e.Element.InnerText);
            #pragma warning restore 0618
        }
 internal static void OnUnknownElement(object sender, XmlElementEventArgs e)
 {
     if (e.Element != null)
     {
         string str = ElementString(e.Element);
         Tracing.OnUnknownElement(sender, e);
         if (e.ExpectedElements == null)
         {
             throw new InvalidOperationException(System.Web.Services.Res.GetString("WebUnknownElement", new object[] { str }));
         }
         if (e.ExpectedElements.Length == 0)
         {
             throw new InvalidOperationException(System.Web.Services.Res.GetString("WebUnknownElement1", new object[] { str }));
         }
         throw new InvalidOperationException(System.Web.Services.Res.GetString("WebUnknownElement2", new object[] { str, e.ExpectedElements }));
     }
 }
Example #6
0
        private static void Handle_Unknown_SDMX_Event(XmlElementEventArgs eElementEventArgs,XmlAttributeEventArgs eAttributeEventArgs,UnreferencedObjectEventArgs eObjectEventArgs)
        {
            Exception ex;
            if (eElementEventArgs != null)
            {
                ex = new Exception(Constants.InvalidElement+ eElementEventArgs.Element.Name);
            }
            else if (eAttributeEventArgs != null)
            {
                ex = new Exception(Constants.InvalidAttribute + eAttributeEventArgs.Attr.Name);
            }
            else if (eObjectEventArgs != null)
            {
                ex = new Exception(Constants.LoadingException);
            }
            else
            {
                ex = new Exception(Constants.LoadingException);
            }

            throw ex;
        }
		/// <summary>
		/// Notify about unknown OpenGL specification elements.
		/// </summary>
		/// <param name="sender">
		/// The <see cref="XmlSerializer"/> parsing the OpenGL specification.
		/// </param>
		/// <param name="e">
		/// A <see cref="XmlElementEventArgs"/> that specifies the event arguments.
		/// </param>
		private static void SpecSerializer_UnknownElement(object sender, XmlElementEventArgs e)
		{
			if (e.Element.Name == "unused")
				return;
			Console.WriteLine("Unknown element {0} at {1}:{2}.", e.Element.Name, e.LineNumber, e.LinePosition);
		}
 public void DeSerializer_UnknownElement(object sender, XmlElementEventArgs e)
 {
     Logger.WriteWarning("Skipping unknown element {0}, in XML document at ({1},{2})", e.Element.Name, e.LineNumber, e.LinePosition);            
 }
 /// <include file='doc\XmlSerializationReader.uex' path='docs/doc[@for="XmlSerializationReader.UnknownElement1"]/*' />
 protected void UnknownElement(object o, XmlElement elem, string qnames) {
     if (events.OnUnknownElement != null) {
         int lineNumber, linePosition;
         GetCurrentPosition(out lineNumber, out linePosition);
         XmlElementEventArgs e = new XmlElementEventArgs(elem, lineNumber, linePosition, o, qnames);
         events.OnUnknownElement(events.sender, e);
     }
 }
Example #10
0
 /// <summary>
 /// Handler for unknown elements.
 /// </summary>
 /// <param name="sender">The sender/</param>
 /// <param name="e">Event arguments.</param>
 private static void HandleUnknownElement(object sender, XmlElementEventArgs e)
 {
     throw new InvalidOperationException(e.ToString() + " Unknown element " + e.Element.Name);
 }
 private static void Serializer_UnknownElement(object sender, XmlElementEventArgs e)
 {
     Debug.LogWarning("Configuration: Unknown element: " + e.Element.Name);
     Debug.LogWarning("Is your configuration syntax invalid?");
     Debug.LogWarning("The default values will be used for all values that cannot be read.");
     Debug.LogWarning("You can genereate a new valid configuration by deleting the old one.");
 }
 internal static void OnUnknownElement(object sender, XmlElementEventArgs e) {
     if (!ValidateSettings(Asmx, TraceEventType.Warning))
         return;
     if (e.Element == null)
         return;
     string xml = RuntimeUtils.ElementString(e.Element);
     string format = e.ExpectedElements == null ? Res.WebUnknownElement : e.ExpectedElements.Length == 0 ? Res.WebUnknownElement1 : Res.WebUnknownElement2;
     TraceEvent(TraceEventType.Warning, Res.GetString(format, xml, e.ExpectedElements));
 }
 private void OnUnknownElement(object sender, XmlElementEventArgs e)
 {
     if ((Thread.CurrentThread.GetHashCode() == this.currentThread) && (e.Element != null))
     {
         SoapUnknownHeader header = new SoapUnknownHeader {
             Element = e.Element
         };
         this.unknownHeaders.Add(header);
     }
 }
Example #14
0
 public void unknownElement(object sender, XmlElementEventArgs e)
 {
     String msg = String.Format("unknown Element: {2}  in Zeile {0} Pos {1}", e.LineNumber, e.LinePosition, e.Element.Name);
     show(msg);
     Console.WriteLine(msg);
 }
Example #15
0
 private static void serializer_UnknownElement(object sender, XmlElementEventArgs e)
 {
     Console.WriteLine("Unknown element {0} at line {1}, col {2}", e.Element.Name, e.LineNumber, e.LinePosition);
 }
Example #16
0
 private void Serializer_UnknownElement(object sender, XmlElementEventArgs e)
 {
     P p = e.ObjectBeingDeserialized as P;
     if (p != null)
     {
         p.Text += e.Element.OuterXml.Replace(" xmlns=\"http://www.w3.org/2006/04/ttaf1\"",string.Empty);
     }
 }
 private static void UnknownElement(object sender, XmlElementEventArgs e)
 {
     Debug.Log("unknown element " + sender.ToString() + " " + e.ToString());
 }
Example #18
0
 private static void Serializer_UnknownElement(object sender, XmlElementEventArgs e)
 {
     Handle_Unknown_SDMX_Event(e,null,null);
 }
Example #19
0
 private static void XmlParseErrorOnElement(object sender, XmlElementEventArgs e)
 {
     throw new XmlException("Error on element attribute " + e.Element + " at " + e.LineNumber + "," +
                            e.LinePosition);
 }
Example #20
0
 private static void xs_UnknownElement(object sender, XmlElementEventArgs e)
 {
     // we don't care about unknown elements
 }
Example #21
0
 static void OnUnknownElement(object sender, XmlElementEventArgs e)
 {
     FieldInfo field = e.ObjectBeingDeserialized.GetType().GetField(e.Element.Name);
     MethodInfo parse = field.FieldType.GetMethod("Parse");
     field.SetValue(e.ObjectBeingDeserialized, parse.Invoke(null, new object[] { e.Element.Value }));
 }
Example #22
0
 void OnUnknownElement(object sender, XmlElementEventArgs e) {
     if (Thread.CurrentThread.GetHashCode() != this.currentThread) return;
     if (e.Element == null) return;
     SoapUnknownHeader header = new SoapUnknownHeader();
     header.Element = e.Element;
     unknownHeaders.Add(header);
 }
Example #23
0
 void UnknownElementHandler(object sender, XmlElementEventArgs e)
 {
     _deserializationTextBuffer.AppendFormat("{0},{1} - 예상하지 못한 항목 '{2}'가 나타났습니다.\r\n",
         e.LineNumber,
         e.LinePosition,
         e.Element.LocalName);
 }
Example #24
0
 /// <summary>
 /// Handles the UnknownElement event of the serializer control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="System.Xml.Serialization.XmlElementEventArgs"/> instance containing the event data.</param>
 private void serializer_UnknownElement( object sender, XmlElementEventArgs e )
 {
     System.Xml.XmlElement elem = e.Element;
     _errorText += String.Format( "unknown element {0}='{1}'", elem.Name, elem.Value );
 }
Example #25
0
		internal virtual void OnUnknownElement (XmlElementEventArgs e) 
		{
			if (onUnknownElement != null) onUnknownElement(this, e);
		}
Example #26
0
		private static void serializer_UnknownElement(object sender, XmlElementEventArgs e)
		{
			Tracer.ErrorFormat("Unknown Element: {0}\t{1}", e.Element.Name, e.Element.Value);
		}
 void mySerializer_UnknownElement(object sender, XmlElementEventArgs e)
 {
     ShowXmlParserError();
 }
 private void OnUnknownElement(object sender, XmlElementEventArgs e)
 {
     Console.Out.WriteLine("Template Serializer. Unknown node is encountered in the tempalte: " + e.Element.Name);
 }
Example #29
0
 public static void helper_UnknownElement(object sender, XmlElementEventArgs e)
 {
     Console.WriteLine("Unknown element found");
     Console.WriteLine("Line: " + e.LineNumber.ToString());
     Console.WriteLine("Element name: " + e.Element.Name);
 }
 internal static void OnUnknownElement(object sender, XmlElementEventArgs e)
 {
     if (ValidateSettings(Asmx, TraceEventType.Warning) && (e.Element != null))
     {
         string str = RuntimeUtils.ElementString(e.Element);
         string name = (e.ExpectedElements == null) ? "WebUnknownElement" : ((e.ExpectedElements.Length == 0) ? "WebUnknownElement1" : "WebUnknownElement2");
         TraceEvent(TraceEventType.Warning, Res.GetString(name, new object[] { str, e.ExpectedElements }));
     }
 }
Example #31
0
		void UnknownElement (object o, XmlElement elem, string qnames)
		{
			int line_number, line_position;
			
			if (Reader is XmlTextReader){
				line_number = ((XmlTextReader)Reader).LineNumber;
				line_position = ((XmlTextReader)Reader).LinePosition;
			} else {
				line_number = 0;
				line_position = 0;
			}

			XmlElementEventArgs args = new XmlElementEventArgs (elem, line_number, line_position, o, qnames);

			if (eventSource != null)
				eventSource.OnUnknownElement (args);
		}
        /// <summary>
        /// Extends BeginInvoke so that when a state object is not needed, null does not need to be passed.
        /// <example>
        /// xmlelementeventhandler.BeginInvoke(sender, e, callback);
        /// </example>
        /// </summary>
        public static IAsyncResult BeginInvoke(this XmlElementEventHandler xmlelementeventhandler, Object sender, XmlElementEventArgs e, AsyncCallback callback)
        {
            if(xmlelementeventhandler == null) throw new ArgumentNullException("xmlelementeventhandler");

            return xmlelementeventhandler.BeginInvoke(sender, e, callback, null);
        }