DesignerSerializationVisibilityAttribute Konstruktor
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Menginisialisasi instans DesignerSerializationVisibilityAttribute baru kelas menggunakan nilai yang ditentukan DesignerSerializationVisibility .
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)
Parameter
- visibility
- DesignerSerializationVisibility
Salah DesignerSerializationVisibility satu nilai.
Contoh
Contoh kode berikut menentukan bagaimana properti pada komponen disimpan oleh perancang. Kode ini membuat baru DesignerSerializationVisibilityAttribute dan menetapkan nilainya ke 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