Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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:
© 2017 Microsoft