ReplaceAttributes Method (Object[])
Collapse the table of content
Expand the table of content

XElement.ReplaceAttributes Method (Object())

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Replaces the attributes of this element with the specified content.

Namespace:  System.Xml.Linq
Assembly:  System.Xml.Linq (in System.Xml.Linq.dll)

'Declaration
Public Sub ReplaceAttributes ( _
	ParamArray content As Object() _
)

Parameters

content
Type: System.Object ()
A parameter list of content objects.

This method first removes existing attributes. It then adds the specified content.

For more information about the valid content that can be passed to this function, see Valid Content of XElement and XDocument Objects in the .NET Framework documentation.

This method will raise the Changed and the Changing events.

The following example creates an element with three attributes. It then replaces the attributes with other attributes.

Dim root As XElement = <Root Att1="1" Att2="2" Att3="3"/>
root.ReplaceAttributes( _
New XAttribute("NewAtt1", 101), _
New XAttribute("NewAtt2", 102), _
New XAttribute("NewAtt3", 103))

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft