IParametersInConsumer.ParametersInReady-Methode
HINWEIS: Diese API ist veraltet.
Stellt einen Ereignishandler für das ParametersInReady -Ereignis eines Anbieters-Webpart, das die IParametersInProvider -Schnittstelle implementiert wird.
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
)
Parameter
sender
Typ: System.ObjectEin Webpart, das die IParametersInProvider -Schnittstelle implementiert wird.
parametersInReadyEventArgs
Typ: Microsoft.SharePoint.WebPartPages.Communication.ParametersInReadyEventArgsEine ParametersInReadyEventArgs , die ein Array von Zeichenfolgen Parameterwerte über seine ParameterValues -Eigenschaft enthält. Die Anzahl und die Reihenfolge von Parametern in dieses Array müssen durch das Argument ParametersInConsumerInitEventArgs der ParametersInConsumerInit -Methode angegebenen übereinstimmen.
Beispiele
Im folgenden Codebeispiel wird die Implementierung von einem ParametersInReady -Ereignishandler. Dieses Codebeispiel ist Teil eines umfangreicheren Beispiels für die IParametersInConsumer -Schnittstelle.
' 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;
}
}