MergablePropertyAttribute.AllowMerge プロパティ

定義

[プロパティ] ウィンドウ内で、プロパティを別のオブジェクトに属するプロパティと組み合わせることができるかどうかを示す値を取得します。

public:
 property bool AllowMerge { bool get(); };
public bool AllowMerge { get; }
member this.AllowMerge : bool
Public ReadOnly Property AllowMerge As Boolean

プロパティ値

[プロパティ] ウィンドウ内で、プロパティを別のオブジェクトに属するプロパティと組み合わせることができる場合は true。それ以外の場合は false

次の例では、マージに適しているかどうかを MyProperty 確認します。 最初に、コードは 次の方法で の属性を MyProperty 取得します。

次に、コードは 内AttributeCollectionの の MergablePropertyAttribute 値に設定myAttributeし、 プロパティがマージに適しているかどうかを確認します。

// Gets the attributes for the property.
AttributeCollection^ attributes = TypeDescriptor::GetProperties( this )[ "MyPropertyProperty" ]->Attributes;

// Checks to see if the property is bindable.
MergablePropertyAttribute^ myAttribute = dynamic_cast<MergablePropertyAttribute^>(attributes[ MergablePropertyAttribute::typeid ]);
if ( myAttribute->AllowMerge )
{
   // Insert code here.
}
// Gets the attributes for the property.
AttributeCollection attributes = 
   TypeDescriptor.GetProperties(this)["MyPropertyProperty"].Attributes;

// Checks to see if the property is bindable.
MergablePropertyAttribute myAttribute = (MergablePropertyAttribute)attributes[typeof(MergablePropertyAttribute)];
if(myAttribute.AllowMerge) {
   // Insert code here.
}
' Gets the attributes for the property.
Dim attributes As AttributeCollection = _
   TypeDescriptor.GetProperties(Me)("MyPropertyProperty").Attributes
       
' Checks to see if the property is bindable.
Dim myAttribute As MergablePropertyAttribute = _
   CType(attributes(GetType(MergablePropertyAttribute)), _
   MergablePropertyAttribute)
If myAttribute.AllowMerge Then
    ' Insert code here.
End If

適用対象

こちらもご覧ください