共用方式為


MergablePropertyAttribute(Boolean) 建構函式

定義

初始化 MergablePropertyAttribute 類別的新執行個體。

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

參數

allowMerge
Boolean

如果這個屬性可以在 [屬性] 視窗中結合其他物件的屬性,則為 true,否則為 false

範例

下列範例會將屬性標示為適合合併。 此程式代碼會建立新的 MergablePropertyAttribute、將其值設定為 MergablePropertyAttribute.Yes,並將它系結至 屬性。

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

適用於

另請參閱