DeliveryRequirementsAttribute Třída

Definice

Určuje požadavky na funkce, které vazby musí poskytovat pro implementaci služby nebo klienta.

public ref class DeliveryRequirementsAttribute sealed : Attribute, System::ServiceModel::Description::IContractBehavior
public ref class DeliveryRequirementsAttribute sealed : Attribute, System::ServiceModel::Description::IContractBehavior, System::ServiceModel::Description::IContractBehaviorAttribute
public sealed class DeliveryRequirementsAttribute : Attribute, System.ServiceModel.Description.IContractBehavior
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Interface, AllowMultiple=true)]
public sealed class DeliveryRequirementsAttribute : Attribute, System.ServiceModel.Description.IContractBehavior, System.ServiceModel.Description.IContractBehaviorAttribute
type DeliveryRequirementsAttribute = class
    inherit Attribute
    interface IContractBehavior
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Interface, AllowMultiple=true)>]
type DeliveryRequirementsAttribute = class
    inherit Attribute
    interface IContractBehavior
    interface IContractBehaviorAttribute
Public NotInheritable Class DeliveryRequirementsAttribute
Inherits Attribute
Implements IContractBehavior
Public NotInheritable Class DeliveryRequirementsAttribute
Inherits Attribute
Implements IContractBehavior, IContractBehaviorAttribute
Dědičnost
DeliveryRequirementsAttribute
Atributy
Implementuje

Příklady

using System;
using System.ServiceModel;

[ServiceContract]
interface ICalculatorService
{
  [OperationBehavior()]
  int Add(int a, int b);

  [OperationContract]
  int Subtract(int a, int b);
}

[DeliveryRequirementsAttribute(
  QueuedDeliveryRequirements=QueuedDeliveryRequirementsMode.NotAllowed,
  RequireOrderedDelivery=true
)]
class CalculatorService: ICalculatorService
{
  public int Add(int a, int b)
  {
    Console.WriteLine("Add called.");
    return a + b;
  }

  public int Subtract(int a, int b)
  {
    Console.WriteLine("Subtract called.");
    return a - b;
  }

  public int Multiply(int a, int b)
  {
    return a * b;
  }
}
Imports System.ServiceModel

<ServiceContract()> _
Public Interface ICalculatorService

    <OperationBehavior()> _
    Function Add(ByVal a As Integer, ByVal b As Integer) As Integer

    <OperationContract()> _
    Function Subtract(ByVal a As Integer, ByVal b As Integer) As Integer
End Interface

<DeliveryRequirements( _
    QueuedDeliveryRequirements:=QueuedDeliveryRequirementsMode.NotAllowed, _
    RequireOrderedDelivery:=True _
)> _
Class CalculatorService
    Public Function add(ByVal a As Integer, ByVal b As Integer) As Integer
        Console.WriteLine("Add called")
        Return a + b
    End Function

    Public Function Subtract(ByVal a As Integer, ByVal b As Integer) As Integer
        Console.WriteLine("Subtract called.")
        Return a - b
    End Function

    Public Function Multiply(ByVal a As Integer, ByVal b As Integer) As Integer
        Return a * b
    End Function
End Class

Poznámky

Pomocí příkazu DeliveryRequirementsAttribute Windows Communication Foundation (WCF) potvrďte, že vazba poskytuje funkce vyžadované službou nebo implementací klienta. DeliveryRequirementsAttribute Pokud je atribut zjištěn, když je popis služby načten z konfiguračního souboru aplikace nebo sestaven programově v kódu, WCF ověří nakonfigurovanou vazbu a podporuje všechny funkce, které atribut určuje. Vaše služba může například vyžadovat vazby pro podporu řízení front. Použití DeliveryRequirementsAttribute technologie WCF umožňuje potvrdit splnění následujících požadavků:

Atribut DeliveryRequirementsAttribute se použije na třídu, která může implementovat libovolný počet rozhraní kontraktů služeb. DeliveryRequirementsAttribute lze použít pro všechny kontrakty, které třída implementuje, nebo pouze na jeden z nich. Atribut lze použít na třídu více než jednou.

Konstruktory

Name Description
DeliveryRequirementsAttribute()

Inicializuje novou instanci DeliveryRequirementsAttribute třídy.

Vlastnosti

Name Description
QueuedDeliveryRequirements

Určuje, jestli vazba pro službu musí podporovat kontrakty zařazené do fronty.

RequireOrderedDelivery

Určuje, jestli vazba musí podporovat seřazené zprávy.

TargetContract

Získá nebo nastaví typ, na který se vztahuje.

TypeId

Při implementaci v odvozené třídě získá jedinečný identifikátor pro tento Attribute.

(Zděděno od Attribute)

Metody

Name Description
Equals(Object)

Vrátí hodnotu, která určuje, zda je tato instance rovna zadanému objektu.

(Zděděno od Attribute)
GetHashCode()

Vrátí kód hash pro tuto instanci.

(Zděděno od Attribute)
GetType()

Získá Type aktuální instance.

(Zděděno od Object)
IsDefaultAttribute()

Při přepsání v odvozené třídě určuje, zda hodnota této instance je výchozí hodnotou pro odvozenou třídu.

(Zděděno od Attribute)
Match(Object)

Při přepsání v odvozené třídě vrátí hodnotu, která určuje, zda se tato instance rovná zadanému objektu.

(Zděděno od Attribute)
MemberwiseClone()

Vytvoří mělkou kopii aktuálního Object.

(Zděděno od Object)
ToString()

Vrátí řetězec, který představuje aktuální objekt.

(Zděděno od Object)

Explicitní implementace rozhraní

Name Description
_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

Mapuje sadu názvů na odpovídající sadu identifikátorů pro rozesílání.

(Zděděno od Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

Načte informace o typu objektu, který lze použít k získání informací o typu pro rozhraní.

(Zděděno od Attribute)
_Attribute.GetTypeInfoCount(UInt32)

Získá počet rozhraní typu informací, které objekt poskytuje (0 nebo 1).

(Zděděno od Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

Poskytuje přístup k vlastnostem a metodám vystaveným objektem.

(Zděděno od Attribute)
IContractBehavior.AddBindingParameters(ContractDescription, ServiceEndpoint, BindingParameterCollection)

Implementuje metodu IContractBehavior.AddBindingParameters(ContractDescription, ServiceEndpoint, BindingParameterCollection) pro správné připojení parametrů vazby.

IContractBehavior.ApplyClientBehavior(ContractDescription, ServiceEndpoint, ClientRuntime)

IContractBehavior.ApplyClientBehavior(ContractDescription, ServiceEndpoint, ClientRuntime) Implementace metody pro podporu klientů

IContractBehavior.ApplyDispatchBehavior(ContractDescription, ServiceEndpoint, DispatchRuntime)

ApplyDispatchBehavior(ContractDescription, ServiceEndpoint, DispatchRuntime) Implementace metody, která umožňuje podporu služeb.

IContractBehavior.Validate(ContractDescription, ServiceEndpoint)

Implementuje metodu IContractBehavior.Validate(ContractDescription, ServiceEndpoint) pro povolení podpory ověřování.

Platí pro