FilterableAttribute 類別

定義

指定套用此屬性 (Attribute) 的屬性 (Property) 是否支援裝置篩選。 此類別無法獲得繼承。

public ref class FilterableAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Property)]
public sealed class FilterableAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Property)>]
type FilterableAttribute = class
    inherit Attribute
Public NotInheritable Class FilterableAttribute
Inherits Attribute
繼承
FilterableAttribute
屬性

範例

下列程式碼範例示範如何將屬性套用 FilterableAttribute 至自訂控制項的 屬性,以指出屬性不支援裝置篩選。


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Samples.AspNet.CS.Controls
{
    public class SimpleCustomControl : WebControl
    {
        private string _productID;

        // Set Filterable attribute to specify that this
        // property does not support device filtering.
        [Bindable(true)]
        [Filterable(false)]
        public string ProductID
        {
            get
            {
                return _productID;
            }
            set
            {
                _productID = value;
            }
        }
    }
}

Imports System.ComponentModel
Imports System.Web.UI

Namespace Samples.AspNet.VB.Controls

    Public Class SimpleCustomControl
        Inherits System.Web.UI.WebControls.WebControl

        Dim _productID As String

        ' Set Filterable attribute to specify that this
        ' property does not support device filtering.
        <Bindable(True), Filterable(False)> Property ProductID() As String
            Get
                Return _productID
            End Get

            Set(ByVal Value As String)
                _productID = Value
            End Set
        End Property
    End Class

End Namespace

備註

屬性 FilterableAttribute 會套用至 屬性,以指定屬性是否支援裝置篩選。 當屬性支援裝置篩選時,您可以藉由指定裝置篩選來覆寫特定裝置的屬性值。 根據預設,屬性是可篩選的,因此控制項開發人員可以將 屬性設定 FilterableAttributefalse 來防止對屬性進行裝置篩選。 如需詳細資訊,請參閱 針對特定裝置自訂

如需使用屬性的詳細資訊,請參閱 屬性

如需 FilterableAttribute 類別之執行個體的初始屬性值清單,請參閱 FilterableAttribute 建構函式。

建構函式

FilterableAttribute(Boolean)

初始化 FilterableAttribute 類別的新執行個體。

欄位

Default

表示具有預設屬性設定的預先定義 FilterableAttribute 物件。 此欄位為唯讀。

No

表示預先定義的 FilterableAttribute 物件,此物件指示屬性不支援裝置篩選。 此欄位為唯讀。

Yes

表示預先定義的 FilterableAttribute 物件,此物件指示屬性支援裝置篩選。 此欄位為唯讀。

屬性

Filterable

取得值,指出套用 FilterableAttribute 屬性 (Attribute) 的屬性 (Property) 是否支援裝置篩選。

TypeId

在衍生類別中實作時,取得這個 Attribute 的唯一識別碼。

(繼承來源 Attribute)

方法

Equals(Object)

判斷 FilterableAttribute 類別目前的執行個體是否等於指定的物件。

GetHashCode()

傳回這個執行個體的雜湊碼。

GetType()

取得目前執行個體的 Type

(繼承來源 Object)
IsDefaultAttribute()

判斷 FilterableAttribute 類別目前的執行個體是否等於 Default 屬性。

IsObjectFilterable(Object)

判斷指定的 Object 是否支援裝置篩選。

IsPropertyFilterable(PropertyDescriptor)

判斷屬性是否支援裝置篩選。

IsTypeFilterable(Type)

判斷指定的資料型別是否支援裝置篩選。

Match(Object)

在衍生類別中覆寫時,會傳回值,表示這個執行個體是否等於指定物件。

(繼承來源 Attribute)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

明確介面實作

_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

將一組名稱對應至一組對應的分派識別項 (Dispatch Identifier)。

(繼承來源 Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

擷取物件的類型資訊,可以用來取得介面的類型資訊。

(繼承來源 Attribute)
_Attribute.GetTypeInfoCount(UInt32)

擷取物件提供的類型資訊介面數目 (0 或 1)。

(繼承來源 Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

提供物件所公開的屬性和方法的存取權。

(繼承來源 Attribute)

適用於

另請參閱