WebBrowsableAttribute Konstruktorer
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Initierar en ny instans av WebBrowsableAttribute klassen.
Överlagringar
| Name | Description |
|---|---|
| WebBrowsableAttribute() |
Initierar en ny instans av WebBrowsableAttribute klassen med egenskapen inställd på Browsable |
| WebBrowsableAttribute(Boolean) |
Initierar en ny instans av WebBrowsableAttribute klassen med det angivna värdet för Browsable egenskapen. |
WebBrowsableAttribute()
Initierar en ny instans av WebBrowsableAttribute klassen med egenskapen inställd på Browsabletrue.
public:
WebBrowsableAttribute();
public WebBrowsableAttribute();
Public Sub New ()
Exempel
I följande kodexempel visas hur du använder WebBrowsableAttribute attributet för att markera en egenskap på en webbdelskontroll som tillgänglig för att visas i en PropertyGridEditorPart kontroll. Egenskapen anges som browsable via WebBrowsableAttribute konstruktorn. Det här exemplet är en del av ett större exempel som finns i klassöversikten PropertyGridEditorPart .
[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
Kommentarer
Konstruktorn WebBrowsableAttribute används när attributet WebBrowsable tillämpas via attributdeklarationen [WebBrowsable()] i C# eller <WebBrowsable()> i Visual Basic.
Gäller för
WebBrowsableAttribute(Boolean)
Initierar en ny instans av WebBrowsableAttribute klassen med det angivna värdet för Browsable egenskapen.
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)
Parametrar
- browsable
- Boolean
Ett booleskt värde som anger om egenskapen ska visas i en PropertyGridEditorPart.
Kommentarer
Konstruktorn WebBrowsableAttribute används när WebBrowsable attributet tillämpas via attributdeklarationen med ett booleskt värde. För att förhindra att en egenskap visas i en PropertyGridEditorPart-kontroll kan egenskapen markeras med attributet [WebBrowsable(false)] i C# eller <WebBrowsable(false)> i Visual Basic.