다음을 통해 공유


XStreamingElement Constructor (XName, Object)

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Initializes a new instance of the XStreamingElement class with the specified name and content.

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

Syntax

'Declaration
Public Sub New ( _
    name As XName, _
    content As Object _
)
public XStreamingElement(
    XName name,
    Object content
)

Parameters

Remarks

This constructor creates a streaming element with the specified content and attributes.

There is an implicit conversion from string to XName. Typical use of this constructor is to specify a string as the parameter instead of creating a new XName.

Queries are not iterated until the XStreamingElement is serialized. This is in contrast to using queries for content for an XElement, where queries are iterated at the time of construction of the new XElement.

For details about the valid content that can be passed to this constructor, see Valid Content of XElement and XDocument Objects.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.