TraceSource.GetSupportedAttributes メソッド
アセンブリ: System (system.dll 内)

Dim returnValue As String() returnValue = Me.GetSupportedAttributes
トレース ソースにサポートされるカスタム属性を指定する文字列配列。カスタム属性がない場合は null 参照 (Visual Basic では Nothing)。

GetSupportedAttributes の既定の実装では、null 参照 (Visual Basic では Nothing) が返されます。
継承時の注意 TraceSource クラスまたは派生クラスから継承する場合は、GetSupportedAttributes メソッドをオーバーライドしてクラスにカスタム属性を提供できます。
MyTraceSource クラスのカスタム属性を識別する、GetSupportedAttributes メソッドのオーバーライドを次のコード例に示します。
Public Class MyTraceSource Inherits TraceSource Private firstAttribute As String = "" Private secondAttribute As String = "" Public Sub New(ByVal n As String) MyBase.New(n) End Sub 'New Public Property FirstTraceSourceAttribute() As String Get Dim de As DictionaryEntry For Each de In Me.Attributes If de.Key.ToString().ToLower() = "firsttracesourceattribute" Then firstAttribute = de.Value.ToString() End If Next de Return firstAttribute End Get Set(ByVal value As String) firstAttribute = value End Set End Property Public Property SecondTraceSourceAttribute() As String Get Dim de As DictionaryEntry For Each de In Me.Attributes If de.Key.ToString().ToLower() = "secondtracesourceattribute" Then secondAttribute = de.Value.ToString() End If Next de Return secondAttribute End Get Set(ByVal value As String) secondAttribute = Value End Set End Property Protected Overrides Function GetSupportedAttributes() As String() ' Allow the use of the attributes in the configuration file. Return New String() {"FirstTraceSourceAttribute", "SecondTraceSourceAttribute"} End Function 'GetSupportedAttributes End Class 'MyTraceSource
public class MyTraceSource : TraceSource { string firstAttribute = ""; string secondAttribute = ""; public MyTraceSource(string n) : base(n) {} public string FirstTraceSourceAttribute { get { foreach (DictionaryEntry de in this.Attributes) if (de.Key.ToString().ToLower() == "firsttracesourceattribute") firstAttribute = de.Value.ToString() ; return firstAttribute; } set { firstAttribute = value; } } public string SecondTraceSourceAttribute { get { foreach (DictionaryEntry de in this.Attributes) if (de.Key.ToString().ToLower() == "secondtracesourceattribute") secondAttribute = de.Value.ToString(); return secondAttribute; } set { secondAttribute = value; } } protected override string[] GetSupportedAttributes() { // Allow the use of the attributes in the configuration file. return new string[] { "FirstTraceSourceAttribute", "SecondTraceSourceAttribute" }; } }

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


Weblioに収録されているすべての辞書からTraceSource.GetSupportedAttributes メソッドを検索する場合は、下記のリンクをクリックしてください。

- TraceSource.GetSupportedAttributes メソッドのページへのリンク