Export (0) Print
Expand All

ParametersOutReadyEventArgs class

NOTE: This API is now obsolete.

Provides an array of parameter values to the ParametersOutReady event of the IParametersOutProvider interface.

System.Object
  System.EventArgs
    Microsoft.SharePoint.WebPartPages.Communication.ParametersOutReadyEventArgs

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

[ObsoleteAttribute("Use System.Web.UI.WebControls.WebParts.IWebPartParameters instead")]
public class ParametersOutReadyEventArgs : EventArgs

The following code example shows an overridden WebPart.PartCommunicationMainmethod that creates an instance of the ParametersOutReadyEventArgs class to send when the ParametersOutReady event occurs. This code example is part of a larger example provided for the IParametersOutProvider interface.

// Step #8: Override the PartCommunicationMain() method.
// The PartCommunicationMain method is called by the Web Part 
// infrastructure on the client during the ASP.NET PreRender
// phase to allow the part to pass its primary data to the other 
// connected parts.
// It is important to always fire either the ParametersOutReady or the 
// NoParametersOut event. Some parts
// may not behave properly if they are left waiting for this 
// information.
// ParametersOutReady should be fired to send the parameters.
// NoParametersOut should be fired to indicate that there is no change 
// in the parameters.public override void PartCommunicationMain()
{
    // Ensure that all of the Web Part's controls are created.
    EnsureChildControls();
    // Check if connected.
    if(_connected)
    {
        // If there is a listener, fire the ParametersOutReady event.
        if(ParametersOutReady != null)
        {
            // Need to create the ParametersOutReadyEventArgs object 
            // for the ParametersOutReady event.

            ParametersOutReadyEventArgs parametersOutReadyEventArgs = new ParametersOutReadyEventArgs();

            if(_parametersReadyButtonClicked) //ParametersOutReady Button was clicked
            {
                // If there is a listener, fire the ParametersOutReady 
                // event.
                if(ParametersOutReady != null)
                {
                    // Set the values to the values of the text
                    // boxes.
                    parametersOutReadyEventArgs.ParameterValues = new string[4];
                    parametersOutReadyEventArgs.ParameterValues[0] = _fontFamilyListBox.SelectedItem.Value;
                    parametersOutReadyEventArgs.ParameterValues[1] = _fontColorListBox.SelectedItem.Value;
                    parametersOutReadyEventArgs.ParameterValues[2] = _fontWeightListBox.SelectedItem.Value;
                    parametersOutReadyEventArgs.ParameterValues[3] = _fontSizeListBox.SelectedItem.Value;

                    // Fire the ParametersOutReady event.
                    ParametersOutReady(this, parametersOutReadyEventArgs);

                    _parametersReadyButtonClicked = false;
                }
            }
            //The NoParametersOut button was clicked.
            else if(_noParametersOutButtonClicked) 
            {
                // If there is a listener, fire the NoParametersOut 
                // event.
                if(NoParametersOut != null)
                {
                    // Fire the event.
                    NoParametersOut(this, new EventArgs());

                    _noParametersOutButtonClicked = false;
                }
            }
            // The user didn't click any button.
            else 
            {
                // If there is a listener, fire the NoParametersOut 
                // event.
                if(NoParametersOut != null)
                {
                    // Fire the event.
                    NoParametersOut(this, new EventArgs());

                    _noParametersOutButtonClicked = false;
                }
            }
        }
    }
}


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show:
© 2014 Microsoft