RecommendedAsConfigurableAttributeとは? わかりやすく解説

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

RecommendedAsConfigurableAttribute クラス

メモ : このクラスは、互換性のために残されています。 旧式でない代替必要な場合は、SettingsBindableAttribute を使用してください

プロパティアプリケーション設定値として使用できることを指定します

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

<AttributeUsageAttribute(AttributeTargets.Property)> _
<ObsoleteAttribute("Use System.ComponentModel.SettingsBindableAttribute
 instead to work with the new settings model.")> _
Public Class RecommendedAsConfigurableAttribute
    Inherits Attribute
Dim instance As RecommendedAsConfigurableAttribute
[AttributeUsageAttribute(AttributeTargets.Property)] 
[ObsoleteAttribute("Use System.ComponentModel.SettingsBindableAttribute instead
 to work with the new settings model.")] 
public class RecommendedAsConfigurableAttribute
 : Attribute
[AttributeUsageAttribute(AttributeTargets::Property)] 
[ObsoleteAttribute(L"Use System.ComponentModel.SettingsBindableAttribute instead
 to work with the new settings model.")] 
public ref class RecommendedAsConfigurableAttribute
 : public Attribute
/** @attribute AttributeUsageAttribute(AttributeTargets.Property) */ 
/** @attribute ObsoleteAttribute("Use System.ComponentModel.SettingsBindableAttribute
 instead to work with the new settings model.") */ 
public class RecommendedAsConfigurableAttribute
 extends Attribute
AttributeUsageAttribute(AttributeTargets.Property) 
ObsoleteAttribute("Use System.ComponentModel.SettingsBindableAttribute instead
 to work with the new settings model.") 
public class RecommendedAsConfigurableAttribute
 extends Attribute
解説解説

RecommendedAsConfigurableAttributetrue設定してマークされプロパティは、[プロパティ] ウィンドウ の ConfigurableProperties の行を展開するときに表示されます。推奨される設定値のないプロパティや、RecommendedAsConfigurableAttributefalse設定してマークされプロパティ表示されません。これらのプロパティは、アプリケーション設定値として使用できません。既定値false です。

RecommendedAsConfigurableAttribute のないプロパティVisual Studio .NET設定値関連付けるには、[プロパティ] ウィンドウの [設定] の下にある [...] ボタンクリックしリストから該当するプロパティ選択します

メモメモ

trueRecommendedAsConfigurableAttribute使用してプロパティマークすると、この属性の値は定数メンバ Yes に設定されます。RecommendedAsConfigurableAttributefalse設定してマークされプロパティ場合、値は No になります。したがってコード内でこの属性の値を確認する場合は、属性RecommendedAsConfigurableAttribute.Yes または RecommendedAsConfigurableAttribute.No として指定する必要があります

詳細については、属性概要属性使用したメタデータ拡張 の各トピック参照してください

.

使用例使用例

プロパティアプリケーション設定値として使用できるようにマークする例を次に示します

<RecommendedAsConfigurable(True)> _
Public Property MyProperty() As
 Integer
    Get
        ' Insert code here.
        Return 0
    End Get
    Set
        ' Insert code here.
    End Set 
End Property
[RecommendedAsConfigurable(true)]
 public int MyProperty {
    get {
       // Insert code here.
       return 0;
    }
    set {
       // Insert code here.
    }
 }
public:
   [RecommendedAsConfigurable(true)]
   property int MyProperty 
   {
      int get()
      {
         // Insert code here.
         return 0;
      }
      void set( int /*value*/
 )
      {
         // Insert code here.
      }
   }
/** @attribute RecommendedAsConfigurable(true)
 */
/** @property
 */
public int get_MyProperty()
{
    // Insert code here.
    return 0;
} //get_MyProperty

/** @property
 */
public void set_MyProperty(int
 value)
{
    // Insert code here.
} //set_MyProperty

MyPropertyRecommendedAsConfigurableAttribute の値を確認する方法次の例に示します最初にオブジェクトすべてのプロパティ保持する PropertyDescriptorCollection を取得します次にインデックス付けて PropertyDescriptorCollection から MyProperty取得します。そして、このプロパティ属性返し、その属性属性変数保存します

この例では、RecommendedAsConfigurableAttribute の値を確認する 2 種類方法示します2 番目のコード片では、Equals メソッド呼び出します。最後コード片では、RecommendedAsConfigurable プロパティ使用して値を確認します

' Gets the attributes for the property.
Dim attributes As AttributeCollection = TypeDescriptor.GetProperties(Me)("MyProperty").Attributes

' Checks to see if the value of the RecommendedAsConfigurableAttribute
 is Yes.
If attributes(GetType(RecommendedAsConfigurableAttribute)).Equals(RecommendedAsConfigurableAttribute.Yes)
 Then
    ' Insert code here.
End If 

' This is another way to see if the property is recommended as configurable.
Dim myAttribute As RecommendedAsConfigurableAttribute
 = _
    CType(attributes(GetType(RecommendedAsConfigurableAttribute)),
 RecommendedAsConfigurableAttribute)
If myAttribute.RecommendedAsConfigurable Then
    ' Insert code here.
End If
// Gets the attributes for the property.
AttributeCollection attributes = 
   TypeDescriptor.GetProperties(this)["MyProperty"].Attributes;
 
// Checks to see if the value of the RecommendedAsConfigurableAttribute
 is Yes.
if(attributes[typeof(RecommendedAsConfigurableAttribute)].Equals(RecommendedAsConfigurableAttribute.Yes))
 {
   // Insert code here.
}
 
// This is another way to see if the property is recommended as configurable.
RecommendedAsConfigurableAttribute myAttribute = 
   (RecommendedAsConfigurableAttribute)attributes[typeof(RecommendedAsConfigurableAttribute)];
if(myAttribute.RecommendedAsConfigurable) {
   // Insert code here.
}
// Gets the attributes for the property.
AttributeCollection^ attributes = TypeDescriptor::GetProperties( this
 )[ "MyProperty" ]->Attributes;

// Checks to see if the value of the RecommendedAsConfigurableAttribute
 is Yes.
if ( attributes[ RecommendedAsConfigurableAttribute::typeid ]->Equals(
 RecommendedAsConfigurableAttribute::Yes ) )
{
   // Insert code here.
}

// This is another way to see if the property is recommended as configurable.
RecommendedAsConfigurableAttribute^ myAttribute = dynamic_cast<RecommendedAsConfigurableAttribute^>(attributes[
 RecommendedAsConfigurableAttribute::typeid ]);
if ( myAttribute->RecommendedAsConfigurable )
{
   // Insert code here.
}
// Gets the attributes for the property.
AttributeCollection attributes = 
    TypeDescriptor.GetProperties(this).get_Item(
    "MyProperty").get_Attributes();

// Checks to see if the value of the
// RecommendedAsConfigurableAttribute is Yes.
if (attributes.get_Item(RecommendedAsConfigurableAttribute.class.
    ToType()).Equals(RecommendedAsConfigurableAttribute.Yes)) {
    // Insert code here.
}

// This is another way to see if the property is recommended
// as configurable.
RecommendedAsConfigurableAttribute myAttribute =
    ((RecommendedAsConfigurableAttribute)(attributes.get_Item
    (RecommendedAsConfigurableAttribute.class.ToType())));

if (myAttribute.get_RecommendedAsConfigurable()) {
    // Insert code here.
}

RecommendedAsConfigurableAttribute使用してクラスマークした場合は、次のコード使用して値を確認します

Dim attributes As AttributeCollection = TypeDescriptor.GetAttributes(MyProperty)
If attributes(GetType(RecommendedAsConfigurableAttribute)).Equals(RecommendedAsConfigurableAttribute.Yes)
 Then
    ' Insert code here.
End If 
AttributeCollection attributes = 
   TypeDescriptor.GetAttributes(MyProperty);
if(attributes[typeof(RecommendedAsConfigurableAttribute)].Equals(RecommendedAsConfigurableAttribute.Yes))
 {
   // Insert code here.
}
AttributeCollection^ attributes = TypeDescriptor::GetAttributes( MyProperty );
if ( attributes[ RecommendedAsConfigurableAttribute::typeid ]->Equals(
 RecommendedAsConfigurableAttribute::Yes ) )
{
   // Insert code here.
}
AttributeCollection attributes = 
    TypeDescriptor.GetAttributes("MyProperty");

if (attributes.get_Item(RecommendedAsConfigurableAttribute.class.
    ToType()).Equals(RecommendedAsConfigurableAttribute.Yes)) {
        // Insert code here.
}
継承階層継承階層
System.Object
   System.Attribute
    System.ComponentModel.RecommendedAsConfigurableAttribute
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
RecommendedAsConfigurableAttribute メンバ
System.ComponentModel 名前空間
Attribute
PropertyDescriptor クラス
AttributeCollection クラス
PropertyDescriptorCollection クラス

RecommendedAsConfigurableAttribute コンストラクタ

RecommendedAsConfigurableAttribute クラス新しインスタンス初期化します。

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

Public Sub New ( _
    recommendedAsConfigurable As Boolean _
)
Dim recommendedAsConfigurable As Boolean

Dim instance As New RecommendedAsConfigurableAttribute(recommendedAsConfigurable)
public RecommendedAsConfigurableAttribute (
    bool recommendedAsConfigurable
)
public:
RecommendedAsConfigurableAttribute (
    bool recommendedAsConfigurable
)
public RecommendedAsConfigurableAttribute (
    boolean recommendedAsConfigurable
)
public function RecommendedAsConfigurableAttribute
 (
    recommendedAsConfigurable : boolean
)

パラメータ

recommendedAsConfigurable

この属性関連付けられているプロパティアプリケーション設定値として使用できる場合trueそれ以外場合false

使用例使用例

プロパティアプリケーション設定値として使用できるようにマークする例を次に示します。このコードは、新しRecommendedAsConfigurableAttribute作成し、その値を RecommendedAsConfigurableAttribute.Yes に設定してから、その属性プロパティ関連付けます。

<RecommendedAsConfigurable(True)> _
Public Property MyProperty() As
 Integer
    Get
        ' Insert code here.
        Return 0
    End Get
    Set
        ' Insert code here.
    End Set
End Property

[RecommendedAsConfigurable(true)]
public int MyProperty {
   get {
      // Insert code here.
      return 0;
   }
   set {
      // Insert code here.
   }
}
   
public:
   [RecommendedAsConfigurable(true)]
   property int MyProperty 
   {
      int get()
      {
         // Insert code here.
         return 0;
      }
      void set( int value
 )
      {
         
         // Insert code here.
      }
   }
/** @attribute RecommendedAsConfigurable(true)
 */
/** @property 
 */
public int get_MyProperty()
{
    // Insert code here.
    return 0;
} //get_MyProperty

/** @property 
 */
public void set_MyProperty(int
 value)
{
    // Insert code here.
} //set_MyProperty
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
RecommendedAsConfigurableAttribute クラス
RecommendedAsConfigurableAttribute メンバ
System.ComponentModel 名前空間
RecommendedAsConfigurableAttribute クラス

RecommendedAsConfigurableAttribute フィールド


RecommendedAsConfigurableAttribute プロパティ


パブリック プロパティパブリック プロパティ

  名前 説明
パブリック プロパティ RecommendedAsConfigurable この属性関連付けられているプロパティアプリケーション設定値として使用できるかどうかを示す値を取得します
パブリック プロパティ TypeId  派生クラス実装されている場合は、この Attribute一意識別子取得します。 ( Attribute から継承されます。)
参照参照

関連項目

RecommendedAsConfigurableAttribute クラス
System.ComponentModel 名前空間
Attribute
PropertyDescriptor クラス
AttributeCollection クラス
PropertyDescriptorCollection クラス

RecommendedAsConfigurableAttribute メソッド


パブリック メソッドパブリック メソッド

( プロテクト メソッド参照)
  名前 説明
パブリック メソッド Equals オーバーロードされますオーバーライドされます。 このインスタンス指定したオブジェクト等しかどうか示します
パブリック メソッド GetCustomAttribute  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用され指定した型のカスタム属性取得します。 ( Attribute から継承されます。)
パブリック メソッド GetCustomAttributes  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されカスタム属性配列取得します。 ( Attribute から継承されます。)
パブリック メソッド GetHashCode オーバーライドされます対象インスタンスハッシュ コード返します
パブリック メソッド GetType  現在のインスタンスType取得します。 ( Object から継承されます。)
パブリック メソッド IsDefaultAttribute オーバーライドされます。 このインスタンス内の値がクラス既定値であるかどうか示します
パブリック メソッド IsDefined  オーバーロードされます指定した型のカスタム属性が、アセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されているかどうか判断します。 ( Attribute から継承されます。)
パブリック メソッド Match  派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンス等しかどうかを示す値を返します。 ( Attribute から継承されます。)
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 ( Object から継承されます。)
パブリック メソッド ToString  現在の Object を表す String返します。 ( Object から継承されます。)
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

RecommendedAsConfigurableAttribute クラス
System.ComponentModel 名前空間
Attribute
PropertyDescriptor クラス
AttributeCollection クラス
PropertyDescriptorCollection クラス

RecommendedAsConfigurableAttribute メンバ

プロパティアプリケーション設定値として使用できることを指定します

RecommendedAsConfigurableAttribute データ型公開されるメンバを以下の表に示します


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド RecommendedAsConfigurableAttribute RecommendedAsConfigurableAttribute クラス新しインスタンス初期化します。
パブリック フィールドパブリック フィールド
パブリック プロパティパブリック プロパティ
  名前 説明
パブリック プロパティ RecommendedAsConfigurable この属性関連付けられているプロパティアプリケーション設定値として使用できるかどうかを示す値を取得します
パブリック プロパティ TypeId  派生クラス実装されている場合は、この Attribute一意識別子取得します。(Attribute から継承されます。)
パブリック メソッドパブリック メソッド
( プロテクト メソッド参照)
  名前 説明
パブリック メソッド Equals オーバーロードされますオーバーライドされます。 このインスタンス指定したオブジェクト等しかどうか示します
パブリック メソッド GetCustomAttribute  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用され指定した型のカスタム属性取得します。 (Attribute から継承されます。)
パブリック メソッド GetCustomAttributes  オーバーロードされますアセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されカスタム属性配列取得します。 (Attribute から継承されます。)
パブリック メソッド GetHashCode オーバーライドされます対象インスタンスハッシュ コード返します
パブリック メソッド GetType  現在のインスタンスType取得します。 (Object から継承されます。)
パブリック メソッド IsDefaultAttribute オーバーライドされます。 このインスタンス内の値がクラス既定値であるかどうか示します
パブリック メソッド IsDefined  オーバーロードされます指定した型のカスタム属性が、アセンブリモジュール、型のメンバ、またはメソッド パラメータ適用されているかどうか判断します。 (Attribute から継承されます。)
パブリック メソッド Match  派生クラス内でオーバーライドされたときに、指定したオブジェクトとこのインスタンス等しかどうかを示す値を返します。 (Attribute から継承されます。)
パブリック メソッド ReferenceEquals  指定した複数Object インスタンス同一かどうか判断します。 (Object から継承されます。)
パブリック メソッド ToString  現在の Object を表す String返します。 (Object から継承されます。)
プロテクト メソッドプロテクト メソッド
参照参照

関連項目

RecommendedAsConfigurableAttribute クラス
System.ComponentModel 名前空間
Attribute
PropertyDescriptor クラス
AttributeCollection クラス
PropertyDescriptorCollection クラス



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

辞書ショートカット

すべての辞書の索引

「RecommendedAsConfigurableAttribute」の関連用語

RecommendedAsConfigurableAttributeのお隣キーワード
検索ランキング

   

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



RecommendedAsConfigurableAttributeのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS