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 가져옵니다.

그런 다음 코드는 in AttributeCollectionMergablePropertyAttribute 값으로 설정하고 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

적용 대상

추가 정보