IFilterConsumer.NoFilter 方法

请注意:此 API 现在已过时。

用于响应一条消息,将从提供程序 Web 部件的NoFilter事件提供任何筛选器。

命名空间:  Microsoft.SharePoint.WebPartPages.Communication
程序集:  Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)

语法

声明
<ObsoleteAttribute("Use System.Web.UI.WebControls.WebParts.IWebPartParameters instead")> _
Sub NoFilter ( _
    sender As Object, _
    e As EventArgs _
)
用法
Dim instance As IFilterConsumer
Dim sender As Object
Dim e As EventArgs

instance.NoFilter(sender, e)
[ObsoleteAttribute("Use System.Web.UI.WebControls.WebParts.IWebPartParameters instead")]
void NoFilter(
    Object sender,
    EventArgs e
)

参数

  • sender
    类型:System.Object

    对在提供程序 Web 部件实现 IFilterProvider 接口的对象的引用。

  • e
    类型:System.EventArgs

    从 NoFilter Event传递事件参数。这将 null 对象。

示例

下面的代码示例显示NoFilter方法的实现。此代码示例是示例的一个更大提供的IFilterConsumer接口的一部分。

' Step #11: Implement NoFilter event handler.
' The connected provider part will call this method during its 
' PartCommunicationMain phase to indicate there is no change in the 
' filter. This allows the consumer part to 
' display its cached data instead of recalculating the filter 
' expression or potentially hitting a database again. 
' <param name="sender">Provider Web Part</param>
' <param name="eventArgs">The Event Arguments</param>
Public Sub NoFilter(sender As Object, eventArgs As EventArgs) Implements IFilterConsumer.NoFilter
   ' Ensure that all of the Web Part's controls are created.
   EnsureChildControls()
   
   ' No change in the filter so use cached _cachedRowFilter.
   _rowFilterExpression = _cachedRowFilter.Text
End Sub
// Step #11: Implement NoFilter event handler.
// The connected provider part will call this method during its 
// PartCommunicationMain phase
// to indicate there is no change in the filter. This allows the 
// consumer part to display its cached data instead of recalculating 
// the filter expression or potentially hitting a database again. 
// <param name="sender">Provider Web Part</param>
// <param name="eventArgs">The Event Argumentsr</param>

public void NoFilter(object sender, EventArgs eventArgs)
{
    // Ensure that all of the Web Part's controls are created.
    EnsureChildControls();

    // No change in the filter so use cached _cachedRowFilter.
    _rowFilterExpression = _cachedRowFilter.Text;
}

另请参阅

引用

IFilterConsumer 接口

IFilterConsumer 成员

Microsoft.SharePoint.WebPartPages.Communication 命名空间