Condividi tramite


ParametersInReadyEventArgs.ParameterValues Property

NOTE: This API is now obsolete.

Gets or sets the parameter values provided by a Web Part that implements the IParametersInProvider interface when the ParametersInReady event occurs

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

Syntax

'Declaration
<ObsoleteAttribute("Use System.Web.UI.WebControls.WebParts.IWebPartParameters instead")> _
Public Property ParameterValues As String()
    Get
    Set
'Usage
Dim instance As ParametersInReadyEventArgs
Dim value As String()

value = instance.ParameterValues

instance.ParameterValues = value
[ObsoleteAttribute("Use System.Web.UI.WebControls.WebParts.IWebPartParameters instead")]
public string[] ParameterValues { get; set; }

Property Value

Type: []
An array of parameter values.

Remarks

The ParameterValues property is a one-dimensional array of strings where each string is the value of a parameter. The number and order of parameters contained in this array must match those specified in the ParametersInConsumerInitEventArgs argument of the ParametersInConsumerInit event.

Examples

The following code example shows the implementation of a ParametersInReady event handler that uses the ParameterValues property to get the values from an instance of the ParametersInReadyEventArgs class received from a provider Web Part. 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 'ParametersInReady
      
//  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

ParametersInReadyEventArgs Class

ParametersInReadyEventArgs Members

Microsoft.SharePoint.WebPartPages.Communication Namespace