MergablePropertyAttribute.AllowMerge Özellik

Tanım

Bu özelliğin bir Özellikler penceresi 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

trueBu özellik bir Özellikler penceresi içindeki diğer nesnelere ait özelliklerle birleştirilebiliyorsa; değilse, 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 AttributeCollection değerine MergablePropertyAttribute ayarlanır myAttribute ve özelliğin birleştirme için 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.