MergablePropertyAttribute.AllowMerge Özellik

Tanım

Bu özelliğin Özellikler penceresindeki diğer nesnelere ait özelliklerle birleştirilip birleştirilemeyeceğini belirten bir değer alır.

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

Özellik Değeri

true bu özellik bir Özellikler penceresi içindeki diğer nesnelere ait özelliklerle birleştirilebiliyorsa; aksi takdirde false.

Örnekler

Aşağıdaki örnek, birleştirmenin uygun olup olmadığını MyProperty denetler. İlk olarak kod için öznitelikleri MyProperty alır:

Ardından kod içindeki myAttribute değerini MergablePropertyAttribute ayarlar AttributeCollection ve özelliğin birleştirmeye uygun olup olmadığını denetler.

// 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

Şunlara uygulanır

Ayrıca bkz.