TraceListener.GetSupportedAttributes メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > TraceListener.GetSupportedAttributes メソッドの意味・解説 

TraceListener.GetSupportedAttributes メソッド

メモ : このメソッドは、.NET Framework version 2.0新しく追加されたものです。

トレース リスナによってサポートされカスタム属性取得します

名前空間: System.Diagnostics
アセンブリ: System (system.dll 内)
構文構文

Protected Friend Overridable
 Function GetSupportedAttributes As String()
Dim returnValue As String()

returnValue = Me.GetSupportedAttributes
protected internal virtual string[] GetSupportedAttributes
 ()
protected public:
virtual array<String^>^ GetSupportedAttributes ()
protected String[] GetSupportedAttributes ()
protected internal function
 GetSupportedAttributes () : String[]

戻り値
トレース リスナによってサポートされカスタム属性の名前を付け文字列配列カスタム属性ない場合null 参照 (Visual Basic では Nothing)。

解説解説

GetSupportedAttributes既定実装では、null 参照 (Visual Basic では Nothing) が返されます。

継承時の注意 TraceListener クラスまたは派生クラスから継承する場合は、GetSupportedAttributes メソッドオーバーライドしてクラスカスタム属性を提供できます

使用例使用例

カスタム トレース リスナ対すGetSupportedAttributes メソッドオーバーライド次のコード例示します

<HostProtection(Synchronization:=True)> _
Public Class TestListener
    Inherits TextWriterTraceListener

    Public Sub New(ByVal
 fileName As String)
        MyBase.New(fileName)

    End Sub 'New

    Public Sub New(ByVal
 fileName As String, ByVal
 name As String)
        MyBase.New(fileName, name)

    End Sub 'New

    Public Overrides Sub
 Write(ByVal s As String)
        MyBase.Write(("TestListener "
 + s))

    End Sub 'Write

    Public Overrides Sub
 WriteLine(ByVal s As String)
        MyBase.WriteLine(("TestListener "
 + s))

    End Sub 'WriteLine

    Protected Overrides Function
 GetSupportedAttributes() As String()
        ' The following string array will allow the use of 
        ' the name "customListenerAttribute" in the configuration
 file.
        Return New String()
 {"customListenerAttribute"}

    End Function 'GetSupportedAttributes
End Class 'TestListener 
[HostProtection(Synchronization = true)]
public class TestListener : TextWriterTraceListener
{
    public TestListener(string fileName) :
 base(fileName) { }
    public TestListener(string fileName, string
 name) : base(fileName, name) {}

    public override void Write(string
 s)
    {
        base.Write("TestListener " + s);
    }
    public override void WriteLine(string
 s)
    {
        base.WriteLine("TestListener " + s);
    }
    protected override string[] GetSupportedAttributes()
    {
        // The following string array will allow the use of 
        // the name "customListenerAttribute" in the configuration
 file.
        return new string[]
 { "customListenerAttribute" };
    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からTraceListener.GetSupportedAttributes メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からTraceListener.GetSupportedAttributes メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からTraceListener.GetSupportedAttributes メソッド を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

TraceListener.GetSupportedAttributes メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



TraceListener.GetSupportedAttributes メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS