Clase CellConsumerInitEventArgs

NOTA: esta API está ahora obsoleta.

Identifica la estructura de argumento inicial para la creación de tiempo de diseño. Estos argumentos se pasan al elemento Web conectado como parte del evento CellConsumerInit para indicar que el nombre de los elementos Web conectados y mostrar el nombre de la celda.

Jerarquía de la herencia

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

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

Sintaxis

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

Ejemplos

En el ejemplo de código siguiente se muestra un método invalidado PartCommunicationInit que crea un objeto CellConsumerInitEventArgs , se establece las propiedades FieldName y FieldDisplayName y, a continuación, se desencadena el evento CellConsumerInit . Este ejemplo de código forma parte de un ejemplo más extenso de la interfaz ICellConsumer .

' Step #10: Override the 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 as some 
' parts may not behave properly if this initialization information is 
' not received.
Public Overrides Sub PartCommunicationInit()
    ' Check if connected.
    If _connected Then
        ' Create the CellConsumerInitEventArgs structure for the 
        ' CellConsumerInit event.
        Dim cellConsumerInitArgs As New CellConsumerInitEventArgs()

        ' Set the FieldName and FieldDisplayName values.
        cellConsumerInitArgs.FieldName = _cellName
        cellConsumerInitArgs.FieldDisplayName = _cellDisplayName

        ' Fire the CellConsumerInit event.
        RaiseEvent CellConsumerInit(Me, cellConsumerInitArgs)
    End If
End Sub
// Step #10: Override the 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 as some 
// parts may not behave properly if this initialization information is 
// not received.
public override void PartCommunicationInit()
{
    // Check if connected.
    if(_connected)
    {
        // If there is a listener, fire the CellConsumerInit event.
        if (CellConsumerInit != null)
        {
            // Create the CellConsumerInitEventArgs structure for the 
            // CellConsumerInit event.
            CellConsumerInitEventArgs cellConsumerInitArgs = 
                new CellConsumerInitEventArgs();
            
            // Set the FieldName and FieldDisplayName values.
            cellConsumerInitArgs.FieldName = _cellName;
            cellConsumerInitArgs.FieldDisplayName = _cellDisplayName;

            // Fire the CellConsumerInit event.
            CellConsumerInit(this, cellConsumerInitArgs);
        }
    }
}

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 CellConsumerInitEventArgs

Espacio de nombres Microsoft.SharePoint.WebPartPages.Communication