MergablePropertyAttribute(Boolean) Konstruktor

Definition

Initialisiert eine neue Instanz der MergablePropertyAttribute-Klasse.

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

Parameter

allowMerge
Boolean

true, wenn diese Eigenschaft mit Eigenschaften kombiniert werden kann, die zu anderen Objekten in einem Eigenschaftenfenster gehören; andernfalls false.

Beispiele

Im folgenden Beispiel wird eine Eigenschaft entsprechend zum Zusammenführen markiert. Dieser Code erstellt einen neuen MergablePropertyAttribute, legt seinen Wert auf MergablePropertyAttribute.Yesund bindet ihn an die Eigenschaft.

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

Gilt für:

Weitere Informationen