Compartilhar via


ClientOperation.ParameterInspectors Propriedade

Definição

Obtém ou define uma coleção de objetos IParameterInspector que podem inspecionar e modificar objetos de entrada e de saída para um método de cliente específico.

public:
 property System::Collections::Generic::SynchronizedCollection<System::ServiceModel::Dispatcher::IParameterInspector ^> ^ ParameterInspectors { System::Collections::Generic::SynchronizedCollection<System::ServiceModel::Dispatcher::IParameterInspector ^> ^ get(); };
public System.Collections.Generic.SynchronizedCollection<System.ServiceModel.Dispatcher.IParameterInspector> ParameterInspectors { get; }
member this.ParameterInspectors : System.Collections.Generic.SynchronizedCollection<System.ServiceModel.Dispatcher.IParameterInspector>
Public ReadOnly Property ParameterInspectors As SynchronizedCollection(Of IParameterInspector)

Valor da propriedade

SynchronizedCollection<IParameterInspector>

Uma coleção de implementações IParameterInspector.

Exemplos

O exemplo de código a seguir mostra uma System.ServiceModel.Description.IEndpointBehavior inserção de um inspetor de parâmetro personalizado em cada ClientOperation um na ClientRuntime.Operations propriedade.

#region IEndpointBehavior Members
public void AddBindingParameters(
  ServiceEndpoint endpoint, BindingParameterCollection bindingParameters
) { return; }

public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
{
  clientRuntime.MessageInspectors.Add(new Inspector());
  foreach (ClientOperation op in clientRuntime.Operations)
    op.ParameterInspectors.Add(new Inspector());
}

public void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)
{
  endpointDispatcher.DispatchRuntime.MessageInspectors.Add(new Inspector());
  foreach (DispatchOperation op in endpointDispatcher.DispatchRuntime.Operations)
    op.ParameterInspectors.Add(new Inspector());
}

public void Validate(ServiceEndpoint endpoint){ return; }
#Region "IEndpointBehavior Members"
    Public Sub AddBindingParameters(ByVal endpoint As ServiceEndpoint, ByVal bindingParameters _
                                    As BindingParameterCollection) Implements IEndpointBehavior.AddBindingParameters
        Return
    End Sub

    Public Sub ApplyClientBehavior(ByVal endpoint As ServiceEndpoint, ByVal clientRuntime As ClientRuntime) _
    Implements IEndpointBehavior.ApplyClientBehavior
        clientRuntime.MessageInspectors.Add(New Inspector())
        For Each op As ClientOperation In clientRuntime.Operations
            op.ParameterInspectors.Add(New Inspector())
        Next op
    End Sub

    Public Sub ApplyDispatchBehavior(ByVal endpoint As ServiceEndpoint, ByVal endpointDispatcher As  _
                                     EndpointDispatcher) Implements IEndpointBehavior.ApplyDispatchBehavior
        endpointDispatcher.DispatchRuntime.MessageInspectors.Add(New Inspector())
        For Each op As DispatchOperation In endpointDispatcher.DispatchRuntime.Operations
            op.ParameterInspectors.Add(New Inspector())
        Next op
    End Sub

Public Sub Validate(ByVal endpoint As ServiceEndpoint) Implements IEndpointBehavior.Validate
    Return
End Sub

Comentários

Use a ParameterInspectors propriedade para inserir uma implementação personalizada IParameterInspector ou modificar a atual. Os inspetores de parâmetro são invocados na ordem em que são adicionados à coleção para solicitações e na ordem inversa para respostas.

Aplica-se a