Clase ListProviderInitEventArgs

NOTA: esta API está ahora obsoleta.

Proporciona los nombres de campo y nombres para mostrar campo opcional para la lista proporcionada por un elemento Web que implementa la IListProviderinterface cuando se produce el evento ListProviderInit .

Jerarquía de la herencia

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

Espacio de nombres:  Microsoft.SharePoint.WebPartPages.Communication
Ensamblado:  Microsoft.SharePoint (en Microsoft.SharePoint.dll)

Sintaxis

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

Ejemplos

En el ejemplo de código siguiente se muestra un método invalidado WebPart.PartCommunicationInit que crea una instancia de la clase ListProviderInitEventArgs para enviar cuando se produce el evento ListProviderInit . Este ejemplo de código forma parte de un ejemplo más extenso de la interfaz 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);
        
    }
}

Seguridad para subprocesos

Los miembros static (Shared en Visual Basic) públicos de este tipo son seguros para subprocesos. No se garantiza que los miembros de instancias sean seguros para los subprocesos.

Vea también

Referencia

Miembros ListProviderInitEventArgs

Espacio de nombres Microsoft.SharePoint.WebPartPages.Communication