XhtmlTextWriter コンストラクタ (TextWriter, String)
アセンブリ: System.Web (system.web.dll 内)

Dim writer As TextWriter Dim tabString As String Dim instance As New XhtmlTextWriter(writer, tabString)
public XhtmlTextWriter ( TextWriter writer, string tabString )
public: XhtmlTextWriter ( TextWriter^ writer, String^ tabString )
public XhtmlTextWriter ( TextWriter writer, String tabString )

XhtmlTextWriter クラスから派生したカスタム クラスに対して 2 つのコンストラクタを作成する方法を次のコード例に示します。この方法は、HtmlTextWriter クラスから直接または間接的に派生するすべてのクラスに対しての標準的な方法です。
' 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 'New Public Sub New(writer As TextWriter, tabString As String) MyBase.New(writer, tabString) End Sub 'New
// 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. /** @attribute AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal) */ /** @attribute AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal) */ public class CustomXhtmlTextWriter extends XhtmlTextWriter { // Create two constructors, following // the pattern for implementing a // TextWriter constructor. public CustomXhtmlTextWriter(TextWriter writer) { this(writer, DefaultTabString); } //CustomXhtmlTextWriter public CustomXhtmlTextWriter(TextWriter writer, String tabString) { super(writer, tabString); } //CustomXhtmlTextWriter

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


XhtmlTextWriter コンストラクタ

名前 | 説明 |
---|---|
XhtmlTextWriter (TextWriter) | DefaultTabString フィールドに指定されている行インデントを使用する、XhtmlTextWriter クラスの新しいインスタンスを初期化します。既定の行インデントを変更しない場合に XhtmlTextWriter コンストラクタを使用します。 |
XhtmlTextWriter (TextWriter, String) | tabString パラメータに行インデントを指定して、XhtmlTextWriter クラスの新しいインスタンスを初期化します。サーバー コントロールまたは ASP.NET ページの行インデントをカスタマイズする場合、XhtmlTextWriter コンストラクタを使用します。 |

XhtmlTextWriter コンストラクタ (TextWriter)
アセンブリ: System.Web (system.web.dll 内)

Public Sub New ( _ writer As TextWriter _ )
public XhtmlTextWriter ( TextWriter writer )
public: XhtmlTextWriter ( TextWriter^ writer )
public XhtmlTextWriter ( TextWriter writer )
public function XhtmlTextWriter ( writer : TextWriter )

XhtmlTextWriter コンストラクタは、TextWriter オブジェクトをパラメータとして受け取り、2 つ目のコンストラクタを呼び出して、次の 2 つのパラメータ値をこのコンストラクタに渡します。

XhtmlTextWriter クラスから派生したカスタム クラスに対して 2 つのコンストラクタを作成する方法を次のコード例に示します。この方法は、HtmlTextWriter クラスから直接または間接的に派生するすべてのクラスに対しての標準的な方法です。
' 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 'New Public Sub New(writer As TextWriter, tabString As String) MyBase.New(writer, tabString) End Sub 'New
// 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. /** @attribute AspNetHostingPermission(SecurityAction.Demand, Level = AspNetHostingPermissionLevel.Minimal) */ /** @attribute AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal) */ public class CustomXhtmlTextWriter extends XhtmlTextWriter { // Create two constructors, following // the pattern for implementing a // TextWriter constructor. public CustomXhtmlTextWriter(TextWriter writer) { this(writer, DefaultTabString); } //CustomXhtmlTextWriter public CustomXhtmlTextWriter(TextWriter writer, String tabString) { super(writer, tabString); } //CustomXhtmlTextWriter

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- XhtmlTextWriter コンストラクタのページへのリンク