Nyelv

MergablePropertyAttribute(Boolean) Konstruktor

Definíció

Inicializálja a MergablePropertyAttribute osztály új példányát.

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

Paraméterek

allowMerge
Boolean

true, ha ez a tulajdonság kombinálható a Tulajdonságok ablak más objektumaihoz tartozó tulajdonságokkal; ellenkező esetben false.

Példák

Az alábbi példa egy tulajdonságot jelöl az egyesítéshez. Ez a kód létrehoz egy újat MergablePropertyAttribute, beállítja annak értékét MergablePropertyAttribute.Yes, és a tulajdonsághoz köti.

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

A következőre érvényes:

Lásd még