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
其中一個 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