Udostępnij przez


DataBindingHandlerAttribute.HandlerTypeName Właściwość

Definicja

Pobiera nazwę typu programu obsługi powiązania danych.

public:
 property System::String ^ HandlerTypeName { System::String ^ get(); };
public string HandlerTypeName { get; }
member this.HandlerTypeName : string
Public ReadOnly Property HandlerTypeName As String

Wartość właściwości

Nazwa typu programu obsługi. Jeśli nazwa typu to null, ta właściwość zwraca pusty ciąg ("").

Przykłady

Poniższy przykład kodu pobiera HandlerTypeName właściwość z wystąpienia DataBindingHandlerAttribute klasy .

[
  DataBindingHandlerAttribute(typeof(System.Web.UI.Design.TextDataBindingHandler))
]
public class SimpleWebControl:WebControl
{
   // Insert code for class members here
}

class TestAttributes
{
   public static void Main()
   {
      System.ComponentModel.AttributeCollection myAttributes = 
         TypeDescriptor.GetAttributes(typeof(SimpleWebControl));

      DataBindingHandlerAttribute myDataBindingHandlerAttribute = 
         myAttributes[typeof(DataBindingHandlerAttribute)] as DataBindingHandlerAttribute;

      if(myDataBindingHandlerAttribute != null)
      {
         Console.Write("DataBindingHandlerAttribute's HandlerTypeName is : " + 
               myDataBindingHandlerAttribute.HandlerTypeName);
      }
   }
}
<DataBindingHandlerAttribute(GetType(System.Web.UI.Design.TextDataBindingHandler))>  _
Public Class SimpleWebControl
   Inherits WebControl
   ' Insert code for class members here
End Class

Class TestAttributes
   
   Public Shared Sub Main()
      Dim myAttributes As System.ComponentModel.AttributeCollection = _
         TypeDescriptor.GetAttributes(GetType(SimpleWebControl))
      
      Dim myDataBindingHandlerAttribute As DataBindingHandlerAttribute = _
         myAttributes(GetType(DataBindingHandlerAttribute))
      
      If Not (myDataBindingHandlerAttribute Is Nothing) Then
         Console.Write(("DataBindingHandlerAttribute's HandlerTypeName is : " + _
            myDataBindingHandlerAttribute.HandlerTypeName))
      End If
   End Sub
End Class

Dotyczy