Partager via


ParametersOutProviderInitEventArgs.ParameterOutProperties - Propriété

Remarque : cette API est désormais obsolète.

Obtient ou définit les valeurs de propriété d'un tableau de paramètres fournis par un composant qui implémente l'interface IParametersOutProvider lorsque l'événement ParametersOutProviderInit se produit.

Espace de noms :  Microsoft.SharePoint.WebPartPages.Communication
Assembly :  Microsoft.SharePoint (dans Microsoft.SharePoint.dll)

Syntaxe

'Déclaration
<ObsoleteAttribute("Use System.Web.UI.WebControls.WebParts.IWebPartParameters instead")> _
Public Property ParameterOutProperties As ParameterOutProperty()
    Get
    Set
'Utilisation
Dim instance As ParametersOutProviderInitEventArgs
Dim value As ParameterOutProperty()

value = instance.ParameterOutProperties

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

Valeur de propriété

Type : []
Tableau de type ParameterOutProperty qui spécifie les valeurs de paramètre.

Remarques

La propriété ParameterOutProperties fournit un tableau d'objets ParameterOutProperty , chacun d'eux correspond à un paramètre. Le nombre et l'ordre des paramètres représentées dans ce tableau doivent correspondre à ceux spécifiés dans l'argument ParametersInReadyEventArgs de l'événement ParametersOutReady .

Exemples

L'exemple de code suivant montre une méthode substituée PartCommunicationInit qui utilise la propriété ParametersOutProperties pour définir le tableau de valeurs d'une instance de la classe ParametersOutProviderInitEventArgs . Cet exemple de code fait partie d'un exemple plus développé fourni pour l'interface IParametersOutProvider .

// Step #7: Override the PartCommunicationInit method.
// The PartCommunicationInit method 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)
    {
        // If there is a listener, send init event.
        if (ParametersOutProviderInit != null)
        {
            // Need to create the ParametersOutProviderInitEventArgs object for the ParametersOutProviderInit event.
            ParametersOutProviderInitEventArgs parametersOutProviderInitInitEventArgs = new ParametersOutProviderInitEventArgs();
            
            // Set the ParameterOutProperties.
            parametersOutProviderInitInitEventArgs.ParameterOutProperties = new ParameterOutProperty[4];

            // There are 4 parameters types that will be passed: Font Family, Color, Weight, and Size.
            parametersOutProviderInitInitEventArgs.ParameterOutProperties[0] = new ParameterOutProperty();
            parametersOutProviderInitInitEventArgs.ParameterOutProperties[0].Description = _fontFamilyParamDescription;
            parametersOutProviderInitInitEventArgs.ParameterOutProperties[0].ParameterDisplayName = _fontFamilyParamDisplayName;
            parametersOutProviderInitInitEventArgs.ParameterOutProperties[0].ParameterName = _fontFamilyParamName;

            parametersOutProviderInitInitEventArgs.ParameterOutProperties[1] = new ParameterOutProperty();
            parametersOutProviderInitInitEventArgs.ParameterOutProperties[1].Description = _fontColorParamDescription;
            parametersOutProviderInitInitEventArgs.ParameterOutProperties[1].ParameterDisplayName = _fontColorParamDisplayName;
            parametersOutProviderInitInitEventArgs.ParameterOutProperties[1].ParameterName = _fontColorParamName;

            parametersOutProviderInitInitEventArgs.ParameterOutProperties[2] = new ParameterOutProperty();
            parametersOutProviderInitInitEventArgs.ParameterOutProperties[2].Description = _fontWeightParamDescription;
            parametersOutProviderInitInitEventArgs.ParameterOutProperties[2].ParameterDisplayName = _fontWeightParamDisplayName;
            parametersOutProviderInitInitEventArgs.ParameterOutProperties[2].ParameterName = _fontWeightParamName;

            parametersOutProviderInitInitEventArgs.ParameterOutProperties[3] = new ParameterOutProperty();
            parametersOutProviderInitInitEventArgs.ParameterOutProperties[3].Description = _fontSizeParamDescription;
            parametersOutProviderInitInitEventArgs.ParameterOutProperties[3].ParameterDisplayName = _fontSizeParamDisplayName;
            parametersOutProviderInitInitEventArgs.ParameterOutProperties[3].ParameterName = _fontSizeParamName;

            // Fire the ParametersOutProviderInit event.
            ParametersOutProviderInit(this, parametersOutProviderInitInitEventArgs);
        }
    }
}
' Step #7: Override the PartCommunicationInit method.
' The PartCommunicationInit method 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.
    EnsureChildControls()

    ' Check if connected.
    If _connected Then
        ' If there is a listener, send init event.
        If ParametersOutProviderInit IsNot Nothing Then
            ' Need to create the ParametersOutProviderInitEventArgs object for the ParametersOutProviderInit event.
            Dim parametersOutProviderInitInitEventArgs As New ParametersOutProviderInitEventArgs()

            ' Set the ParameterOutProperties.
            parametersOutProviderInitInitEventArgs.ParameterOutProperties = New ParameterOutProperty(3){}

            ' There are 4 parameters types that will be passed: Font Family, Color, Weight, and Size.
            parametersOutProviderInitInitEventArgs.ParameterOutProperties(0) = New ParameterOutProperty()
            parametersOutProviderInitInitEventArgs.ParameterOutProperties(0).Description = _fontFamilyParamDescription
            parametersOutProviderInitInitEventArgs.ParameterOutProperties(0).ParameterDisplayName = _fontFamilyParamDisplayName
            parametersOutProviderInitInitEventArgs.ParameterOutProperties(0).ParameterName = _fontFamilyParamName

            parametersOutProviderInitInitEventArgs.ParameterOutProperties(1) = New ParameterOutProperty()
            parametersOutProviderInitInitEventArgs.ParameterOutProperties(1).Description = _fontColorParamDescription
            parametersOutProviderInitInitEventArgs.ParameterOutProperties(1).ParameterDisplayName = _fontColorParamDisplayName
            parametersOutProviderInitInitEventArgs.ParameterOutProperties(1).ParameterName = _fontColorParamName

            parametersOutProviderInitInitEventArgs.ParameterOutProperties(2) = New ParameterOutProperty()
            parametersOutProviderInitInitEventArgs.ParameterOutProperties(2).Description = _fontWeightParamDescription
            parametersOutProviderInitInitEventArgs.ParameterOutProperties(2).ParameterDisplayName = _fontWeightParamDisplayName
            parametersOutProviderInitInitEventArgs.ParameterOutProperties(2).ParameterName = _fontWeightParamName

            parametersOutProviderInitInitEventArgs.ParameterOutProperties(3) = New ParameterOutProperty()
            parametersOutProviderInitInitEventArgs.ParameterOutProperties(3).Description = _fontSizeParamDescription
            parametersOutProviderInitInitEventArgs.ParameterOutProperties(3).ParameterDisplayName = _fontSizeParamDisplayName
            parametersOutProviderInitInitEventArgs.ParameterOutProperties(3).ParameterName = _fontSizeParamName

            ' Fire the ParametersOutProviderInit event.
            RaiseEvent ParametersOutProviderInit(Me, parametersOutProviderInitInitEventArgs)
        End If
    End If
End Sub

Voir aussi

Référence

ParametersOutProviderInitEventArgs classe

ParametersOutProviderInitEventArgs - Membres

Microsoft.SharePoint.WebPartPages.Communication - Espace de noms