共用方式為


ListProviderInitEventArgs class

NOTE: This API is now obsolete.

提供的欄位名稱和選擇性欄位提供實作IListProviderinterfaceListProviderInit事件發生時的網頁組件清單的顯示名稱。

Inheritance hierarchy

System.Object
  System.EventArgs
    Microsoft.SharePoint.WebPartPages.Communication.InitEventArgs
      Microsoft.SharePoint.WebPartPages.Communication.ListProviderInitEventArgs

Namespace:  Microsoft.SharePoint.WebPartPages.Communication
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'宣告
<ObsoleteAttribute("Use System.Web.UI.WebControls.WebParts.IWebPartTable instead")> _
Public NotInheritable Class ListProviderInitEventArgs _
    Inherits InitEventArgs
'用途
Dim instance As ListProviderInitEventArgs
[ObsoleteAttribute("Use System.Web.UI.WebControls.WebParts.IWebPartTable instead")]
public sealed class ListProviderInitEventArgs : InitEventArgs

Examples

下列程式碼範例顯示建立ListProviderInit事件發生時傳送ListProviderInitEventArgs類別的執行個體覆寫的WebPart.PartCommunicationInit方法。這個程式碼範例是提供IListProvider介面的完整範例的一部分。

 ' Step #7: Override PartCommunicationInit method.
' PartCommunicationInit() is called by the Web Part infrastructure during the ASP.NET PreRender 
' event to allow the part to pass initialization information to the other connected parts.
' It is important to always pass initialization information. Some parts
' may not behave properly if this initialization information is not received.
Public Overrides Sub PartCommunicationInit()
   ' Ensure that all of the Web Part's controls are created.
   

   ' Ensure that all of the Web Part's controls are created.
   EnsureChildControls()
   
   ' Check if connected.
   If _connected Then

         'Create the ListProviderInitEventArgs object for the ListProviderInit event.
         Dim listProviderInitArgs As New ListProviderInitEventArgs()
         
         ' Set the list field names.
         listProviderInitArgs.FieldList = _listFieldNames
         listProviderInitArgs.FieldDisplayList = _listFieldDisplayNames
         
         ' Fire the ListProviderInit event.
          ListProviderInit(Me, listProviderInitArgs)

   End If
End Sub 'PartCommunicationInit
// Step #7: Override PartCommunicationInit method.
// PartCommunicationInit() is called by the Web Part infrastructure during the ASP.NET PreRender 
// event to allow the part to pass initialization information to the other connected parts.
// It is important to always pass initialization information. Some parts
// may not behave properly if this initialization information is not received.

public override void PartCommunicationInit()
{
    // Ensure that all of the Web Part's controls are created.
    EnsureChildControls();

    // Check if connected.
    if(_connected)
    {
       
            //Create the ListProviderInitEventArgs object for the ListProviderInit event.
            ListProviderInitEventArgs listProviderInitArgs = new ListProviderInitEventArgs();
    
            // Set the list field names.
            listProviderInitArgs.FieldList = _listFieldNames;
            listProviderInitArgs.FieldDisplayList = _listFieldDisplayNames;

            // Fire the ListProviderInit event.
            ListProviderInit(this, listProviderInitArgs);
        
    }
}

Thread safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

請參閱

參照

ListProviderInitEventArgs members

Microsoft.SharePoint.WebPartPages.Communication namespace