WSHttpBindingBase.IBindingRuntimePreferences.ReceiveSynchronously 屬性

定義

取得值,這個值會指出要以同步或非同步方式處理傳入要求。

property bool System::ServiceModel::Channels::IBindingRuntimePreferences::ReceiveSynchronously { bool get(); };
bool System.ServiceModel.Channels.IBindingRuntimePreferences.ReceiveSynchronously { get; }
member this.System.ServiceModel.Channels.IBindingRuntimePreferences.ReceiveSynchronously : bool
 ReadOnly Property ReceiveSynchronously As Boolean Implements IBindingRuntimePreferences.ReceiveSynchronously

屬性值

如果是以同步方式處理要求,則為 true,如果是以非同步方式處理要求,則為 false。 預設為 false,這樣會以非同步方式處理要求。

實作

範例

這個範例會示範如何使用 ReceiveSynchronously 成員。

static void SnippetReceiveSynchronously ()
{
    WSHttpBinding binding = new WSHttpBinding();
    IBindingRuntimePreferences s  =
                       binding.GetProperty<IBindingRuntimePreferences>
                       (new BindingParameterCollection());
    bool receiveSynchronously = s.ReceiveSynchronously;
}
Private Shared Sub SnippetReceiveSynchronously()
    Dim binding As New WSHttpBinding()
    Dim s As IBindingRuntimePreferences = binding.GetProperty(Of IBindingRuntimePreferences) (New BindingParameterCollection())
        Dim receiveSynchronously = s.ReceiveSynchronously

End Sub

適用於