DataBindingHandlerAttribute.HandlerTypeName 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得資料繫結處理常式的型別名稱。
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