DataBindingHandlerAttribute.HandlerTypeName 屬性

定義

取得資料繫結處理常式的型別名稱。

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

屬性值

指定處理常式的型別名稱。 如果型別名稱是 null,這個屬性會傳回空字串 ("")。

範例

下列程式碼範例會 HandlerTypeName 從 類別的 DataBindingHandlerAttribute 實例擷取 屬性。

[
  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

適用於