Freigeben über


ListProviderInitEventArgs-Klasse

HINWEIS: Diese API ist veraltet.

Enthält die Feldnamen und ein optionales Feld Anzeigenamen für die Liste zur Verfügung gestellt von einem Webpart, das die IListProviderinterface implementiert wird, wenn das ListProviderInit -Ereignis eintritt.

Vererbungshierarchie

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

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

Beispiele

Das folgende Codebeispiel zeigt eine überschriebene WebPart.PartCommunicationInit -Methode, die erstellt eine Instanz der Klasse ListProviderInitEventArgs zu senden, wenn das ListProviderInit -Ereignis tritt auf. Dieses Codebeispiel ist Teil eines umfangreicheren Beispiels für die IListProvider -Schnittstelle.

 ' 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);
        
    }
}

Threadsicherheit

Alle öffentlichen static (Shared in Visual Basic) Member dieses Typs sind threadsicher. Die Threadsicherheit von Instanzmembern ist nicht gewährleistet.

Siehe auch

Referenz

ListProviderInitEventArgs-Member

Microsoft.SharePoint.WebPartPages.Communication-Namespace