XStreamingElement 생성자

정의

XStreamingElement 클래스의 새 인스턴스를 초기화합니다.

오버로드

Name Description
XStreamingElement(XName)

지정된 클래스에서 클래스의 XElement 새 인스턴스를 초기화합니다 XName.

XStreamingElement(XName, Object)

지정된 이름과 콘텐츠를 사용하여 클래스의 XStreamingElement 새 인스턴스를 초기화합니다.

XStreamingElement(XName, Object[])

지정된 이름과 콘텐츠를 사용하여 클래스의 XStreamingElement 새 인스턴스를 초기화합니다.

설명

쿼리는 serialize될 때까지 XStreamingElement 반복되지 않습니다. 이는 새 XElement쿼리를 생성할 때 쿼리가 반복되는 콘텐츠에 대한 XElement쿼리를 사용하는 것과는 대조적입니다.

이 생성자에 전달할 수 있는 유효한 콘텐츠에 대한 자세한 내용은 XElement 및 XDocument 개체의 유효한 콘텐츠를 참조하세요.

XStreamingElement(XName)

Source:
XStreamingElement.cs
Source:
XStreamingElement.cs
Source:
XStreamingElement.cs
Source:
XStreamingElement.cs
Source:
XStreamingElement.cs

지정된 클래스에서 클래스의 XElement 새 인스턴스를 초기화합니다 XName.

public:
 XStreamingElement(System::Xml::Linq::XName ^ name);
public XStreamingElement(System.Xml.Linq.XName name);
new System.Xml.Linq.XStreamingElement : System.Xml.Linq.XName -> System.Xml.Linq.XStreamingElement
Public Sub New (name As XName)

매개 변수

name
XName

XName 요소의 이름이 들어 있는 항목입니다.

예제

XElement srcTree = new XElement("Root",
                       new XElement("Child", 1),
                       new XElement("Child", 2),
                       new XElement("Child", 3),
                       new XElement("Child", 4),
                       new XElement("Child", 5)
                   );

XStreamingElement dstTree = new XStreamingElement("NewRoot",
                        from el in srcTree.Elements()
                        where (int)el >= 3
                        select new XElement("DifferentChild", (int)el)
                    );

Console.WriteLine(dstTree);
Dim srcTree As XElement = _
        <Root>
            <Child>1</Child>
            <Child>2</Child>
            <Child>3</Child>
            <Child>4</Child>
            <Child>5</Child>
        </Root>

Dim dstTree As XStreamingElement = New XStreamingElement("NewRoot", _
                From el In srcTree.Elements _
                Where el.Value >= 3 _
                Select <DifferentChild><%= el.Value %></DifferentChild> _
            )

Console.WriteLine(dstTree)

이 예제는 다음과 같은 출력을 생성합니다.

<NewRoot>
  <DifferentChild>3</DifferentChild>
  <DifferentChild>4</DifferentChild>
  <DifferentChild>5</DifferentChild>
</NewRoot>

설명

이 생성자는 콘텐츠와 특성이 없는 스트리밍 요소를 만듭니다.

문자열에서 .로의 암시적 변환이 있습니다 XName. 이 생성자의 일반적인 사용은 새 XName문자열을 만드는 대신 매개 변수로 문자열을 지정하는 것입니다.

추가 정보

적용 대상

XStreamingElement(XName, Object)

Source:
XStreamingElement.cs
Source:
XStreamingElement.cs
Source:
XStreamingElement.cs
Source:
XStreamingElement.cs
Source:
XStreamingElement.cs

지정된 이름과 콘텐츠를 사용하여 클래스의 XStreamingElement 새 인스턴스를 초기화합니다.

public:
 XStreamingElement(System::Xml::Linq::XName ^ name, System::Object ^ content);
public XStreamingElement(System.Xml.Linq.XName name, object content);
public XStreamingElement(System.Xml.Linq.XName name, object? content);
new System.Xml.Linq.XStreamingElement : System.Xml.Linq.XName * obj -> System.Xml.Linq.XStreamingElement
Public Sub New (name As XName, content As Object)

매개 변수

name
XName

XName 요소 이름을 포함하는 항목입니다.

content
Object

요소의 내용입니다.

예제

이 예제에서는 Source.xml다음과 같은 XML 파일을 사용합니다.

<?xml version="1.0" encoding="utf-8" ?>
<Root>
  <Child Key="01">
    <GrandChild>aaa</GrandChild>
  </Child>
  <Child Key="02">
    <GrandChild>bbb</GrandChild>
  </Child>
  <Child Key="03">
    <GrandChild>ccc</GrandChild>
  </Child>
</Root>

설명

이 생성자는 지정된 콘텐츠 및 특성을 사용하여 스트리밍 요소를 만듭니다.

문자열에서 .로의 암시적 변환이 있습니다 XName. 이 생성자의 일반적인 사용은 새 XName문자열을 만드는 대신 매개 변수로 문자열을 지정하는 것입니다.

쿼리는 serialize될 때까지 XStreamingElement 반복되지 않습니다. 이는 새 XElement쿼리를 생성할 때 쿼리가 반복되는 콘텐츠에 대한 XElement쿼리를 사용하는 것과는 대조적입니다.

이 생성자에 전달할 수 있는 유효한 콘텐츠에 대한 자세한 내용은 XElement 및 XDocument 개체의 유효한 콘텐츠를 참조하세요.

추가 정보

적용 대상

XStreamingElement(XName, Object[])

Source:
XStreamingElement.cs
Source:
XStreamingElement.cs
Source:
XStreamingElement.cs
Source:
XStreamingElement.cs
Source:
XStreamingElement.cs

지정된 이름과 콘텐츠를 사용하여 클래스의 XStreamingElement 새 인스턴스를 초기화합니다.

public:
 XStreamingElement(System::Xml::Linq::XName ^ name, ... cli::array <System::Object ^> ^ content);
public XStreamingElement(System.Xml.Linq.XName name, params object[] content);
public XStreamingElement(System.Xml.Linq.XName name, params object?[] content);
new System.Xml.Linq.XStreamingElement : System.Xml.Linq.XName * obj[] -> System.Xml.Linq.XStreamingElement
Public Sub New (name As XName, ParamArray content As Object())

매개 변수

name
XName

XName 요소 이름을 포함하는 항목입니다.

content
Object[]

요소의 내용입니다.

예제

이 예제에서는 Source.xml다음과 같은 XML 파일을 사용합니다.

<?xml version="1.0" encoding="utf-8" ?>
<Root>
  <Child Key="01">
    <GrandChild>aaa</GrandChild>
  </Child>
  <Child Key="02">
    <GrandChild>bbb</GrandChild>
  </Child>
  <Child Key="03">
    <GrandChild>ccc</GrandChild>
  </Child>
</Root>

설명

이 생성자는 지정된 콘텐츠 및 특성을 사용하여 스트리밍 요소를 만듭니다.

문자열에서 .로의 암시적 변환이 있습니다 XName. 이 생성자의 일반적인 사용은 새 XName문자열을 만드는 대신 매개 변수로 문자열을 지정하는 것입니다.

쿼리는 serialize될 때까지 XStreamingElement 반복되지 않습니다. 이는 새 XElement쿼리를 생성할 때 쿼리가 반복되는 콘텐츠에 대한 XElement쿼리를 사용하는 것과는 대조적입니다.

이 함수에 전달할 수 있는 유효한 콘텐츠에 대한 자세한 내용은 XElement 및 XDocument 개체의 유효한 콘텐츠를 참조하세요.

추가 정보

적용 대상