ClientRuntime.Operations ClientRuntime.Operations ClientRuntime.Operations ClientRuntime.Operations Property

Определение

Возвращает коллекцию клиентских операций для клиента.Gets a collection of client operations for a client.

public:
 property System::Collections::ObjectModel::KeyedCollection<System::String ^, System::ServiceModel::Dispatcher::ClientOperation ^> ^ Operations { System::Collections::ObjectModel::KeyedCollection<System::String ^, System::ServiceModel::Dispatcher::ClientOperation ^> ^ get(); };
public System.Collections.ObjectModel.KeyedCollection<string,System.ServiceModel.Dispatcher.ClientOperation> Operations { get; }
member this.Operations : System.Collections.ObjectModel.KeyedCollection<string, System.ServiceModel.Dispatcher.ClientOperation>
Public ReadOnly Property Operations As KeyedCollection(Of String, ClientOperation)

Значение свойства

Синхронизированная коллекция объектов ClientOperation.A synchronized collection of ClientOperation objects.

Примеры

В следующем примере кода System.ServiceModel.Description.IEndpointBehavior вставляет System.ServiceModel.Dispatcher.IParameterInspector в клиентскую среду выполнения, добавляя его во все объекты ClientOperation в свойстве Operations.In the following code example an System.ServiceModel.Description.IEndpointBehavior inserts a System.ServiceModel.Dispatcher.IParameterInspector into the client runtime by adding it to each ClientOperation in the Operations property.

#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

Комментарии

Используйте свойство Operations, чтобы получить коллекцию всех клиентских операций для данного клиента, которую можно использовать для подключения объектов расширения, которые проверяют или изменяют сообщения и поведение для определенной операции.Use the Operations property to get a collection of all client operations for this client that you can use to attach extension objects that inspect or modify messages and behavior scoped to a particular operation. Дополнительные сведения см. в разделе ClientOperation.For details, see ClientOperation.

Применяется к