MergablePropertyAttribute::AllowMerge Property

 

Gets a value indicating whether this property can be combined with properties belonging to other objects in a Properties window.

Namespace:   System.ComponentModel
Assembly:  System (in System.dll)

public:
property bool AllowMerge {
	bool get();
}

Property Value

Type: System::Boolean

true 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:

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.
}

.NET Framework
Available since 1.1
Return to top
Show: