DesignerSerializationVisibilityAttribute 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
使用指定的 DesignerSerializationVisibility 值初始化 DesignerSerializationVisibilityAttribute 类的新实例。
public:
DesignerSerializationVisibilityAttribute(System::ComponentModel::DesignerSerializationVisibility visibility);
public DesignerSerializationVisibilityAttribute (System.ComponentModel.DesignerSerializationVisibility visibility);
new System.ComponentModel.DesignerSerializationVisibilityAttribute : System.ComponentModel.DesignerSerializationVisibility -> System.ComponentModel.DesignerSerializationVisibilityAttribute
Public Sub New (visibility As DesignerSerializationVisibility)
参数
- visibility
- DesignerSerializationVisibility
示例
下面的代码示例指定设计器如何保存组件上的属性。 此代码创建一个新的 DesignerSerializationVisibilityAttribute ,并将其值设置为 DesignerSerializationVisibilityAttribute.Content。
public:
[DesignerSerializationVisibility(DesignerSerializationVisibility::Content)]
property int MyProperty
{
int get()
{
// Insert code here.
return (0);
}
void set( int value )
{
// Insert code here.
}
}
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public int MyProperty {
get {
// Insert code here.
return(0);
}
set {
// Insert code here.
}
}
<DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
Public Property _
MyProperty() As Integer
Get
' Insert code here.
Return 0
End Get
Set
' Insert code here.
End Set
End Property