Bagikan melalui


DesignerSerializationVisibilityAttribute Konstruktor

Definisi

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

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

Berlaku untuk

Lihat juga