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

适用于

另请参阅