MergablePropertyAttribute.AllowMerge 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
이 속성을 속성 창의 다른 개체에 속한 속성과 결합할 수 있는지 여부를 나타내는 값을 가져옵니다.
public:
property bool AllowMerge { bool get(); };
public bool AllowMerge { get; }
member this.AllowMerge : bool
Public ReadOnly Property AllowMerge As Boolean
속성 값
이 속성을 속성 창 다른 개체에 속한 속성과 결합할 수 있으면 true, 그렇지 않으면 false.
예제
다음 예제에서는 병합에 적합한지 확인 MyProperty 합니다. 먼저 코드는 다음 기준의 특성을 MyProperty 가져옵니다.
개체의 PropertyDescriptorCollection 모든 속성을 사용하여 검색합니다.
가져올
MyProperty인 PropertyDescriptorCollection 덱싱.특성 변수에 이 속성의 특성을 저장합니다.
그런 다음 코드는 in 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