ListProviderInitEventArgs - Classe
Remarque : cette API est désormais obsolète.
Fournit les noms de champ et les noms complets de champ facultatif pour la liste fournie par un composant qui implémente le IListProviderinterface lorsque l'événement ListProviderInit se produit.
Hiérarchie d’héritage
System.Object
System.EventArgs
Microsoft.SharePoint.WebPartPages.Communication.InitEventArgs
Microsoft.SharePoint.WebPartPages.Communication.ListProviderInitEventArgs
Espace de noms : Microsoft.SharePoint.WebPartPages.Communication
Assembly : Microsoft.SharePoint (dans Microsoft.SharePoint.dll)
Syntaxe
'Déclaration
<ObsoleteAttribute("Use System.Web.UI.WebControls.WebParts.IWebPartTable instead")> _
Public NotInheritable Class ListProviderInitEventArgs _
Inherits InitEventArgs
'Utilisation
Dim instance As ListProviderInitEventArgs
[ObsoleteAttribute("Use System.Web.UI.WebControls.WebParts.IWebPartTable instead")]
public sealed class ListProviderInitEventArgs : InitEventArgs
Exemples
L'exemple de code suivant montre une méthode substituée WebPart.PartCommunicationInit qui crée une instance de la classe ListProviderInitEventArgs à envoyer lors de l'événement ListProviderInit se produit. Cet exemple de code fait partie d'un exemple plus développé fourni pour l'interface 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);
}
}
Cohérence de thread
Tous les membres statique (Partagé dans Visual Basic)s publics de ce type sont thread-safe. Cela n’est pas garanti pour les membres d’instance.
Voir aussi
Référence
ListProviderInitEventArgs - Membres
Microsoft.SharePoint.WebPartPages.Communication - Espace de noms