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

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

Switch.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 メソッドオーバーライド次のコード例示します

Public Class MySourceSwitch
    Inherits SourceSwitch
    Private sourceAttribute As Integer
 = 0

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

    End Sub 'New

    Public Property CustomSourceSwitchAttribute()
 As Integer
        Get
            Dim de As DictionaryEntry
            For Each de In
 Me.Attributes
                If de.Key.ToString().ToLower() = "customsourceswitchattribute"
 Then
                    sourceAttribute = Fix(de.Value)
                End If
            Next de
            Return sourceAttribute
        End Get
        Set(ByVal value As
 Integer)
            sourceAttribute = Fix(Value)
        End Set
    End Property

    Protected Overrides Function
 GetSupportedAttributes() As String()
        Return New String()
 {"customsourceSwitchattribute"}

    End Function 'GetSupportedAttributes
End Class 'MySourceSwitch
public class MySourceSwitch : SourceSwitch
{
    int sourceAttribute = 0;
    public MySourceSwitch(string n) : base(n)
 { }
    public int CustomSourceSwitchAttribute
    {
        get
        {
            foreach (DictionaryEntry de in
 this.Attributes)
                if (de.Key.ToString().ToLower() == "customsourceswitchattribute")
                    sourceAttribute = (int)de.Value;
            return sourceAttribute;
        }
        set { sourceAttribute = (int)value;
 }
    }

    protected override string[] GetSupportedAttributes()
    {
        return new string[]
 { "customsourceSwitchattribute" };
    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

「Switch.GetSupportedAttributes メソッド」の関連用語

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

   

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



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

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

©2024 GRAS Group, Inc.RSS