ClientRuntime.Operations 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得用戶端之用戶端作業的集合。
public:
property System::Collections::Generic::SynchronizedKeyedCollection<System::String ^, System::ServiceModel::Dispatcher::ClientOperation ^> ^ Operations { System::Collections::Generic::SynchronizedKeyedCollection<System::String ^, System::ServiceModel::Dispatcher::ClientOperation ^> ^ get(); };
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.Generic.SynchronizedKeyedCollection<string,System.ServiceModel.Dispatcher.ClientOperation> Operations { get; }
public System.Collections.ObjectModel.KeyedCollection<string,System.ServiceModel.Dispatcher.ClientOperation> Operations { get; }
member this.Operations : System.Collections.Generic.SynchronizedKeyedCollection<string, System.ServiceModel.Dispatcher.ClientOperation>
member this.Operations : System.Collections.ObjectModel.KeyedCollection<string, System.ServiceModel.Dispatcher.ClientOperation>
Public ReadOnly Property Operations As SynchronizedKeyedCollection(Of String, ClientOperation)
Public ReadOnly Property Operations As KeyedCollection(Of String, ClientOperation)
屬性值
ClientOperation 物件的已同步處理集合。
範例
在下列程式碼範例中,System.ServiceModel.Description.IEndpointBehavior 會將 System.ServiceModel.Dispatcher.IParameterInspector 加入至 ClientOperation 屬性中的每一個 Operations,以便將其插入用戶端執行階段中。
#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 屬性,即可取得這個用戶端的所有用戶端作業集合,而您可以使用這些作業來附加負責檢查或修改範圍限定於特定作業之訊息及行為的擴充物件。 如需詳細資訊,請參閱 ClientOperation。