本文整理汇总了VB.NET中System.Xml.Serialization.XmlElementAttributes.Add方法的典型用法代码示例。如果您正苦于以下问题:VB.NET XmlElementAttributes.Add方法的具体用法?VB.NET XmlElementAttributes.Add怎么用?VB.NET XmlElementAttributes.Add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.Serialization.XmlElementAttributes
的用法示例。
在下文中一共展示了XmlElementAttributes.Add方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: CreateOverrider
Public Function CreateOverrider() As XmlSerializer
' Create XmlAttributes and XmlAttributeOverrides instances.
Dim attrs As New XmlAttributes()
Dim xOver As New XmlAttributeOverrides()
' Create an XmlElementAttributes to override
' the Vehicles property.
Dim xElement1 As New XmlElementAttribute(GetType(Truck))
' Add the XmlElementAttribute to the collection.
attrs.XmlElements.Add(xElement1)
' Create a second XmlElementAttribute, and
' add to the collection.
Dim xElement2 As New XmlElementAttribute(GetType(Train))
attrs.XmlElements.Add(xElement2)
' Add the XmlAttributes to the XmlAttributeOverrides,
' specifying the member to override.
xOver.Add(GetType(Transportation), "Vehicles", attrs)
' Create the XmlSerializer, and return it.
Dim xSer As New XmlSerializer(GetType(Transportation), xOver)
Return xSer
End Function
End Class