FilterableAttribute(Boolean) Construtor
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Inicializa uma nova instância da FilterableAttribute classe.
public:
FilterableAttribute(bool filterable);
public FilterableAttribute(bool filterable);
new System.Web.UI.FilterableAttribute : bool -> System.Web.UI.FilterableAttribute
Public Sub New (filterable As Boolean)
Parâmetros
- filterable
- Boolean
true para indicar que a propriedade a que o atributo é aplicado suporta filtragem de dispositivos; caso contrário, false.
Exemplos
O exemplo de código seguinte demonstra como aplicar um FilterableAttribute atributo a uma propriedade de um controlo personalizado. Este construtor é chamado internamente por ASP.NET para criar um objeto FilterableAttribute que representa o atributo.
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
Observações
Use este construtor para criar uma nova instância da FilterableAttribute classe. A tabela seguinte mostra o valor inicial da propriedade para uma instância da FilterableAttribute classe.
| Property | Valor Inicial |
|---|---|
| Filterable | O valor do filterable parâmetro. |