Sdílet prostřednictvím


SendActivity.CustomAddress Vlastnost

Definice

Získá nebo nastaví vlastní adresu použitou ke komunikaci se službou.

public:
 property System::String ^ CustomAddress { System::String ^ get(); void set(System::String ^ value); };
public string CustomAddress { get; set; }
member this.CustomAddress : string with get, set
Public Property CustomAddress As String

Hodnota vlastnosti

String

Řetězcová hodnota, jejíž hodnota je adresa, na které služba naslouchá.

Příklady

Následující příklad ukazuje, jak získat přístup k CustomAddress vlastnosti. Tento příklad byl upraven z ukázky CalculatorClient sady SDK.

static public void ApplyEndpointAddress(SendActivity activity, EndpointAddress epr)
{
    if (activity.ExecutionStatus == ActivityExecutionStatus.Initialized)
    {
        if (epr.Uri != null)
        {
            activity.CustomAddress = epr.Uri.ToString();
        }
        if (epr.Headers != null && epr.Headers.Count > 0)
        {
            AddressHeader contextHeader = epr.Headers.FindHeader(contextHeaderName, contextHeaderNamespace);
            IDictionary<string, string> context = contextHeader.GetValue<Dictionary<string, string>>();
            activity.Context = context;
        }
    }
}

Poznámky

V případě přítomnosti se tato hodnota použije k definování adresy koncového bodu pro operaci.

Platí pro