Bagikan melalui


WebBrowsableAttribute Konstruktor

Definisi

Menginisialisasi instans baru kelas WebBrowsableAttribute.

Overload

WebBrowsableAttribute()

Menginisialisasi instans WebBrowsableAttribute baru kelas dengan properti yang Browsable diatur ke true.

WebBrowsableAttribute(Boolean)

Menginisialisasi instans WebBrowsableAttribute baru kelas dengan nilai yang ditentukan untuk Browsable properti .

WebBrowsableAttribute()

Menginisialisasi instans WebBrowsableAttribute baru kelas dengan properti yang Browsable diatur ke true.

public:
 WebBrowsableAttribute();
public WebBrowsableAttribute ();
Public Sub New ()

Contoh

Contoh kode berikut menunjukkan cara menggunakan WebBrowsableAttribute atribut untuk menandai properti pada kontrol Komponen Web sebagai tersedia untuk ditampilkan dalam PropertyGridEditorPart kontrol. Properti diatur sebagai dapat dijelajahi WebBrowsableAttribute melalui konstruktor. Contoh ini adalah bagian dari contoh yang lebih besar yang ditemukan dalam PropertyGridEditorPart gambaran umum kelas.

[Personalizable(), WebBrowsable(), WebDisplayName("Job Type"), 
  WebDescription("Select the category that corresponds to your job.")]
public JobTypeName UserJobType
{
  get
  {
    object o = ViewState["UserJobType"];
    if (o != null)
      return (JobTypeName)o;
    else
      return _userJobType;
  }

  set { _userJobType = (JobTypeName)value; }
}
<Personalizable(), WebBrowsable(), WebDisplayName("Job Type"), _
  WebDescription("Select the category that corresponds to your job.")> _
Public Property UserJobType() As JobTypeName
  Get
    Dim o As Object = ViewState("UserJobType")
    If Not (o Is Nothing) Then
      Return CType(o, JobTypeName)
    Else
      Return _userJobType
    End If
  End Get
  Set(ByVal value As JobTypeName)
    _userJobType = CType(value, JobTypeName)
  End Set
End Property

Keterangan

WebBrowsableAttribute Konstruktor digunakan saat WebBrowsable atribut diterapkan melalui deklarasi [WebBrowsable()] atribut di C# atau <WebBrowsable()> di Visual Basic.

Berlaku untuk

WebBrowsableAttribute(Boolean)

Menginisialisasi instans WebBrowsableAttribute baru kelas dengan nilai yang ditentukan untuk Browsable properti .

public:
 WebBrowsableAttribute(bool browsable);
public WebBrowsableAttribute (bool browsable);
new System.Web.UI.WebControls.WebParts.WebBrowsableAttribute : bool -> System.Web.UI.WebControls.WebParts.WebBrowsableAttribute
Public Sub New (browsable As Boolean)

Parameter

browsable
Boolean

Nilai Boolean yang menunjukkan apakah properti harus ditampilkan dalam PropertyGridEditorPart.

Keterangan

WebBrowsableAttribute Konstruktor digunakan saat WebBrowsable atribut diterapkan melalui deklarasi atribut dengan nilai Boolean. Untuk mencegah properti ditampilkan dalam PropertyGridEditorPart kontrol, properti dapat ditandai dengan atribut [WebBrowsable(false)] di C# atau <WebBrowsable(false)> di Visual Basic.

Berlaku untuk