Share via


XhtmlTextWriter 생성자

정의

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

오버로드

XhtmlTextWriter(TextWriter)

XhtmlTextWriter 필드에 지정된 줄 들여쓰기를 사용하는 DefaultTabString 클래스의 새 인스턴스를 초기화합니다. 기본 줄 들여쓰기를 변경하지 않으려면 XhtmlTextWriter(TextWriter) 생성자를 사용합니다.

XhtmlTextWriter(TextWriter, String)

지정한 줄 들여쓰기를 사용하는 XhtmlTextWriter 클래스의 새 인스턴스를 초기화합니다.

XhtmlTextWriter(TextWriter)

XhtmlTextWriter 필드에 지정된 줄 들여쓰기를 사용하는 DefaultTabString 클래스의 새 인스턴스를 초기화합니다. 기본 줄 들여쓰기를 변경하지 않으려면 XhtmlTextWriter(TextWriter) 생성자를 사용합니다.

public:
 XhtmlTextWriter(System::IO::TextWriter ^ writer);
public XhtmlTextWriter (System.IO.TextWriter writer);
new System.Web.UI.XhtmlTextWriter : System.IO.TextWriter -> System.Web.UI.XhtmlTextWriter
Public Sub New (writer As TextWriter)

매개 변수

writer
TextWriter

XHTML 내용을 렌더링하는 TextWriter 인스턴스입니다.

예제

다음 코드 예제에서는 두 생성자를 만드는 방법을 보여 줍니다.는 클래스에서 직접 또는 간접적으로 파생 되는 모든 클래스에 대 한 표준은 클래스에서 HtmlTextWriterXhtmlTextWriter 파생 된 사용자 지정 클래스에 대 한 합니다.

// Create a class that inherits from XhtmlTextWriter.
[AspNetHostingPermission(SecurityAction.Demand, 
    Level=AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission(SecurityAction.InheritanceDemand, 
    Level=AspNetHostingPermissionLevel.Minimal)] 
public class CustomXhtmlTextWriter : XhtmlTextWriter
{
    // Create two constructors, following 
    // the pattern for implementing a
    // TextWriter constructor.
    public CustomXhtmlTextWriter(TextWriter writer) : 
        this(writer, DefaultTabString)
    {
    }

    public CustomXhtmlTextWriter(TextWriter writer, string tabString) : 
        base(writer, tabString)
    {
    }
' Create a class that inherits from XhtmlTextWriter.
<AspNetHostingPermission(SecurityAction.Demand, _
    Level:=AspNetHostingPermissionLevel.Minimal)> _
<AspNetHostingPermission(SecurityAction.InheritanceDemand, _
    Level:=AspNetHostingPermissionLevel.Minimal)> _
Public Class CustomXhtmlTextWriter
    Inherits XhtmlTextWriter

    ' Create two constructors, following 
    ' the pattern for implementing a
    ' TextWriter constructor.
    Public Sub New(writer As TextWriter)
      MyClass.New(writer, DefaultTabString)
    End Sub


    Public Sub New(writer As TextWriter, tabString As String)
      MyBase.New(writer, tabString)
    End Sub

설명

XhtmlTextWriter 개체를 TextWriter 매개 변수로 사용하는 생성자는 두 번째 생성자를 호출하여 두 개의 매개 변수 값을 전달합니다.

  • TextWriter 인스턴스입니다.

  • XHTML 텍스트 작성기에서 DefaultTabString 사용하는 탭 간격을 정의하는 필드에 지정된 문자열 값입니다.

적용 대상

XhtmlTextWriter(TextWriter, String)

지정한 줄 들여쓰기를 사용하는 XhtmlTextWriter 클래스의 새 인스턴스를 초기화합니다.

public:
 XhtmlTextWriter(System::IO::TextWriter ^ writer, System::String ^ tabString);
public XhtmlTextWriter (System.IO.TextWriter writer, string tabString);
new System.Web.UI.XhtmlTextWriter : System.IO.TextWriter * string -> System.Web.UI.XhtmlTextWriter
Public Sub New (writer As TextWriter, tabString As String)

매개 변수

writer
TextWriter

XHTML 내용을 렌더링하는 TextWriter 인스턴스입니다.

tabString
String

줄 들여쓰기를 렌더링하는 데 사용할 문자열입니다.

예제

다음 코드 예제에서는 두 생성자를 만드는 방법을 보여 줍니다.는 클래스에서 직접 또는 간접적으로 파생 되는 모든 클래스에 대 한 표준은 클래스에서 HtmlTextWriterXhtmlTextWriter 파생 된 사용자 지정 클래스에 대 한 합니다.

// Create a class that inherits from XhtmlTextWriter.
[AspNetHostingPermission(SecurityAction.Demand, 
    Level=AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission(SecurityAction.InheritanceDemand, 
    Level=AspNetHostingPermissionLevel.Minimal)] 
public class CustomXhtmlTextWriter : XhtmlTextWriter
{
    // Create two constructors, following 
    // the pattern for implementing a
    // TextWriter constructor.
    public CustomXhtmlTextWriter(TextWriter writer) : 
        this(writer, DefaultTabString)
    {
    }

    public CustomXhtmlTextWriter(TextWriter writer, string tabString) : 
        base(writer, tabString)
    {
    }
' Create a class that inherits from XhtmlTextWriter.
<AspNetHostingPermission(SecurityAction.Demand, _
    Level:=AspNetHostingPermissionLevel.Minimal)> _
<AspNetHostingPermission(SecurityAction.InheritanceDemand, _
    Level:=AspNetHostingPermissionLevel.Minimal)> _
Public Class CustomXhtmlTextWriter
    Inherits XhtmlTextWriter

    ' Create two constructors, following 
    ' the pattern for implementing a
    ' TextWriter constructor.
    Public Sub New(writer As TextWriter)
      MyClass.New(writer, DefaultTabString)
    End Sub


    Public Sub New(writer As TextWriter, tabString As String)
      MyBase.New(writer, tabString)
    End Sub

적용 대상