Upraviť

Zdieľať cez


MergablePropertyAttribute(Boolean) Constructor

Definition

Initializes a new instance of the MergablePropertyAttribute class.

public:
 MergablePropertyAttribute(bool allowMerge);
public MergablePropertyAttribute (bool allowMerge);
new System.ComponentModel.MergablePropertyAttribute : bool -> System.ComponentModel.MergablePropertyAttribute
Public Sub New (allowMerge As Boolean)

Parameters

allowMerge
Boolean

true if this property can be combined with properties belonging to other objects in a Properties window; otherwise, false.

Examples

The following example marks a property as appropriate to merge. This code creates a new MergablePropertyAttribute, sets its value to MergablePropertyAttribute.Yes, and binds it to the property.

public:
   [MergableProperty(true)]
   property int MyProperty 
   {
      int get()
      {
         // Insert code here.
         return 0;
      }
      void set( int value )
      {
         // Insert code here.
      }
   }

[MergableProperty(true)]
public int MyProperty {
   get {
      // Insert code here.
     return 0;
   }
   set {
      // Insert code here.
   }
}
<MergableProperty(True)> _    
Public Property MyProperty() As Integer
    Get
        ' Insert code here.
        Return 0
    End Get
    Set
        ' Insert code here.
    End Set 
End Property

Applies to

See also