本文整理汇总了VB.NET中System.Xml.Serialization.XmlNodeEventHandler代理的典型用法代码示例。如果您正苦于以下问题:VB.NET XmlNodeEventHandler代理的具体用法?VB.NET XmlNodeEventHandler怎么用?VB.NET XmlNodeEventHandler使用的例子?那么恭喜您, 这里精选的代理代码示例或许可以为您提供帮助。
在下文中一共展示了XmlNodeEventHandler代理的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: DeserializeItem
Private Sub DeserializeItem(ByVal filename As String)
Dim mySerializer As New XmlSerializer(GetType(ObjectToDeserialize))
' Add an instance of the delegate to the event.
AddHandler mySerializer.UnknownNode, AddressOf Serializer_UnknownNode
' A FileStream is needed to read the file to deserialize.
Dim fs As New FileStream(filename, FileMode.Open)
Dim o As ObjectToDeserialize = _
CType(mySerializer.Deserialize(fs), ObjectToDeserialize)
End Sub
Private Sub Serializer_UnknownNode _
(ByVal sender As Object, _
ByVal e As XmlNodeEventArgs)
Console.WriteLine("UnknownNode Name: " & e.Name)
Console.WriteLine("UnknownNode LocalName: " & e.LocalName)
Console.WriteLine("UnknownNode Namespace URI: " & e.NamespaceURI)
Console.WriteLine("UnknownNode Text: " & e.Text)
Dim o As Object = e.ObjectBeingDeserialized
Console.WriteLine("Object being deserialized " & o.ToString())
Dim myNodeType As XmlNodeType = e.NodeType
Console.WriteLine(myNodeType)
End Sub