Compartilhar via


IParametersInConsumer.ParametersInReady Method

NOTE: This API is now obsolete.

Provides an event handler for the ParametersInReady event of a provider Web Part that implements the IParametersInProvider interface.

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

Syntax

'Declaration
<ObsoleteAttribute("Use System.Web.UI.WebControls.WebParts.IWebPartParameters instead")> _
Sub ParametersInReady ( _
    sender As Object, _
    parametersInReadyEventArgs As ParametersInReadyEventArgs _
)
'Usage
Dim instance As IParametersInConsumer
Dim sender As Object
Dim parametersInReadyEventArgs As ParametersInReadyEventArgs

instance.ParametersInReady(sender, parametersInReadyEventArgs)
[ObsoleteAttribute("Use System.Web.UI.WebControls.WebParts.IWebPartParameters instead")]
void ParametersInReady(
    Object sender,
    ParametersInReadyEventArgs parametersInReadyEventArgs
)

Parameters

  • sender
    Type: System.Object

    A Web Part that implements the IParametersInProvider interface.

  • parametersInReadyEventArgs
    Type: Microsoft.SharePoint.WebPartPages.Communication.ParametersInReadyEventArgs

    A ParametersInReadyEventArgs that provides an array of string parameter values through its ParameterValues property. The number and order of parameters contained in this array must match those specified by the ParametersInConsumerInitEventArgs argument of the ParametersInConsumerInit method.

Examples

The following code example shows the implementation of a ParametersInReady event handler. This code example is part of a larger example provided for the IParametersInConsumer interface.

' Step #8: Implement the ParametersInReady event handler.
' The connected provider part may call this method during its 
' PartCommunicationMain phase
' to pass its primary data to the consumer Web Part.
' <param name="sender">Provider Web Part</param>
' <param name="parametersInReadyEventArgs">The args passed by the 
' Provider</param>
Public Sub ParametersInReady(sender As Object, parametersInReadyEventArgs As ParametersInReadyEventArgs) _
      Implements IParametersInConsumer.ParametersInReady
   _parametersInReadyFlag = True
   
   ' Set the text box values to the values of the parameters.
   If Not (parametersInReadyEventArgs.ParameterValues Is Nothing) Then
      _fontFamily = parametersInReadyEventArgs.ParameterValues(0)
      _fontColor = parametersInReadyEventArgs.ParameterValues(1)
      _fontWeight = parametersInReadyEventArgs.ParameterValues(2)
      _fontSize = parametersInReadyEventArgs.ParameterValues(3)
           
      ' Store font attributes in a State Bag for use by the NoParametersIn event handler.
      ViewState("FontFamily") = _fontFamily
      ViewState("FontColor") = _fontColor
      ViewState("FontWeight") = _fontWeight
      ViewState("FontSize") = _fontSize
   End If
End Sub
// Step #8: Implement the ParametersInReady event handler.
// The connected provider part may call this method during its 
// PartCommunicationMain phase
// to pass its primary data to the consumer Web Part.
// <param name="sender">Provider Web Part</param>
// <param name="parametersInReadyEventArgs">The args passed by the 
// Provider</param>
public void ParametersInReady(object sender, ParametersInReadyEventArgs parametersInReadyEventArgs)
{
    _parametersInReadyFlag = true;

    // Set the text box values to the values of the Parameters.
    if(parametersInReadyEventArgs.ParameterValues != null)
    {
        _fontFamily = parametersInReadyEventArgs.ParameterValues[0];
        _fontColor = parametersInReadyEventArgs.ParameterValues[1];
        _fontWeight = parametersInReadyEventArgs.ParameterValues[2];
        _fontSize = parametersInReadyEventArgs.ParameterValues[3];

        // Store font attributes in a State Bag for use by the 
        // NoParametersIn event handler.
        ViewState["FontFamily"] = _fontFamily;
        ViewState["FontColor"] = _fontColor;
        ViewState["FontWeight"] = _fontWeight;
        ViewState["FontSize"] = _fontSize;
    }
}

See Also

Reference

IParametersInConsumer Interface

IParametersInConsumer Members

Microsoft.SharePoint.WebPartPages.Communication Namespace