This documentation is archived and is not being maintained.

MergablePropertyAttribute Constructor

Initializes a new instance of the MergablePropertyAttribute class.

[Visual Basic]
Public Sub New( _
   ByVal allowMerge As Boolean _
)
[C#]
public MergablePropertyAttribute(
   bool allowMerge
);
[C++]
public: MergablePropertyAttribute(
   bool allowMerge
);
[JScript]
public function MergablePropertyAttribute(
   allowMerge : Boolean
);

Parameters

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

Example

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.

[Visual Basic] 
<MergableProperty(True)> _    
Public Property MyProperty() As Integer
    Get
        ' Insert code here.
        Return 0
    End Get
    Set
        ' Insert code here.
    End Set 
End Property


[C#] 

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

[C++] 

public:
    [MergableProperty(true)]
    __property int get_MyProperty() {
        // Insert code here.
        return 0;
    }
    __property void set_MyProperty( int value ) {
        // Insert code here.
    }


[JScript] 
public MergableProperty(true)
function get MyProperty() : int{
   // Insert code here.
   return 0
}

function set MyProperty(value : int){
   // Insert code here.
}

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

MergablePropertyAttribute Class | MergablePropertyAttribute Members | System.ComponentModel Namespace | MergablePropertyAttribute

Show: