ICellConsumer.CellProviderInit method
NOTE: This API is now obsolete.
處理初始化事件CellProviderInit。這個事件處理常式是類型CellProviderInitEventHandler。
Namespace: Microsoft.SharePoint.WebPartPages.Communication
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'宣告
<ObsoleteAttribute("Use System.Web.UI.WebControls.WebParts.IWebPartField instead")> _
Sub CellProviderInit ( _
sender As Object, _
cellProviderInitArgs As CellProviderInitEventArgs _
)
'用途
Dim instance As ICellConsumer
Dim sender As Object
Dim cellProviderInitArgs As CellProviderInitEventArgs
instance.CellProviderInit(sender, cellProviderInitArgs)
[ObsoleteAttribute("Use System.Web.UI.WebControls.WebParts.IWebPartField instead")]
void CellProviderInit(
Object sender,
CellProviderInitEventArgs cellProviderInitArgs
)
參數
sender
Type: System.Object消費者 Web 組件參考。
cellProviderInitArgs
Type: Microsoft.SharePoint.WebPartPages.Communication.CellProviderInitEventArgs提供者網頁組件所傳遞的引數。
Examples
下列程式碼範例會顯示CellProviderInit方法來接收傳送ICellProvider網頁組件的欄位顯示名稱的實作。這個程式碼範例是提供ICellConsumer介面的完整範例的一部分。
這個範例使用Microsoft.SharePoint.Utilities.SPEncode類別,因為它需要using指示詞 (在 Visual Basic 的Imports ) Microsoft.SharePoint.Utilities命名空間。
' Step #8: Implement CellProviderInit event handler.
' The connected provider part(s) will call this method during its
' PartCommunicationInit phase
' to pass initialization information to this consumer Web Part.
' <param name="sender">Reference to the Consumer Web Part</param>
' <param name="cellProviderInitEventArgs">The args passed by the provider Web Part</param>
Public Sub CellProviderInit(sender As Object, cellProviderInitEventArgs
As CellProviderInitEventArgs) Implements ICellConsumer.CellProviderInit
'Encode and store the field display name.
_connectedField = SPEncode.HtmlEncode(cellProviderInitEventArgs.FieldDisplayName)
End Sub
// Step #8: Implement CellProviderInit event handler.
// The connected provider part(s) will call this method during its
// PartCommunicationInit phase
// to pass initialization information to this consumer Web Part.
// <param name="sender">Reference to the Consumer Web Part</param>
// <param name="cellProviderInitEventArgs">The args passed by the
// provider Web Part</param>
public void CellProviderInit(object sender, CellProviderInitEventArgs
cellProviderInitEventArgs)
{
// Encode and store the field display name.
_connectedField = SPEncode.HtmlEncode(cellProviderInitEventArgs.FieldDisplayName);
}