WebDisplayNameAttribute Oluşturucular

Tanım

WebDisplayNameAttribute sınıfının yeni bir örneğini başlatır.

Aşırı Yüklemeler

WebDisplayNameAttribute()

Belirtilen ad olmadan sınıfının yeni bir örneğini WebDisplayNameAttribute başlatır.

WebDisplayNameAttribute(String)

Belirtilen görünen adla sınıfının yeni bir örneğini WebDisplayNameAttribute başlatır.

WebDisplayNameAttribute()

Belirtilen ad olmadan sınıfının yeni bir örneğini WebDisplayNameAttribute başlatır.

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

Açıklamalar

Oluşturucu özelliği WebDisplayNameAttribute boş bir dize ("") olarak ayarlar DisplayName .

Şunlara uygulanır

WebDisplayNameAttribute(String)

Belirtilen görünen adla sınıfının yeni bir örneğini WebDisplayNameAttribute başlatır.

public:
 WebDisplayNameAttribute(System::String ^ displayName);
public WebDisplayNameAttribute (string displayName);
new System.Web.UI.WebControls.WebParts.WebDisplayNameAttribute : string -> System.Web.UI.WebControls.WebParts.WebDisplayNameAttribute
Public Sub New (displayName As String)

Parametreler

displayName
String

içinde PropertyGridEditorPartkullanılacak kolay ad.

Örnekler

Aşağıdaki kod örneği, Web Bölümleri denetimindeki WebDisplayNameAttribute bir özelliğe görünen ad atamak için özniteliğinin nasıl kullanılacağını gösterir. Özel UserJobType özelliğe denetimde PropertyGridEditorPart görüntülenmesi için kolay "İş Türü" adı verilir. Ad oluşturucu aracılığıyla WebDisplayNameAttribute atanır. Bu örnek, sınıfa genel bakış bölümünde PropertyGridEditorPart bulunan daha büyük bir örneğin parçasıdır.

[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

Açıklamalar

Oluşturucu özelliğini WebDisplayNameAttribute olarak DisplayName displayNameayarlar. displayName parametresi, bir PropertyGridEditorPart denetimde görünecek değerdir.

Şunlara uygulanır