MergablePropertyAttribute::AllowMerge Property
Gets a value indicating whether this property can be combined with properties belonging to other objects in a Properties window.
Assembly: System (in System.dll)
Property Value
Type: System::Booleantrue if this property can be combined with properties belonging to other objects in a Properties window; otherwise, false.
The following example checks to see whether MyProperty is appropriate to merge. First the code gets the attributes for MyProperty by:
Retrieving a PropertyDescriptorCollection with all the properties for the object.
Indexing into the PropertyDescriptorCollection to get MyProperty.
Saving the attributes for this property in the attributes variable.
Then the code sets myAttribute to the value of the MergablePropertyAttribute in the AttributeCollection and checks whether the property is appropriate to merge.
// 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. }
Available since 1.1