public IArticlePriceFinishedProcessState StartProcess(IEnumerable <ArticlePriceRequestArticle> articles, Iso4217Code?currency) { ArticlePriceRequest request = this.CreateRequest(articles, currency); ArticlePriceResponse response = this.SendRequest(request, () => { return(this.Dialog.SendRequest(request)); }); return(new ArticlePriceFinishedProcessState(request, response)); }
private void Dialog_RequestReceived(Object sender, MessageReceivedEventArgs <ArticlePriceRequest> e) { ArticlePriceRequest request = e.Message; this.OnMessageReceived(request, () => { IArticlePriceRequestedProcessState processState = new ArticlePriceRequestedProcessState(this, request); this.ProcessStarted?.Invoke(this, new ProcessStartedEventArgs <IArticlePriceRequestedProcessState>(processState)); }); }
public async Task <IArticlePriceFinishedProcessState> StartProcessAsync(IEnumerable <ArticlePriceRequestArticle> articles, Iso4217Code?currency, CancellationToken cancellationToken = default) { ArticlePriceRequest request = this.CreateRequest(articles, currency); ArticlePriceResponse response = await this.SendRequestAsync(request, () => { return(this.Dialog.SendRequestAsync(request, cancellationToken)); }).ConfigureAwait(continueOnCapturedContext: false); return(new ArticlePriceFinishedProcessState(request, response)); }
/// <summary> /// Processes an incomming article price request. /// </summary> /// <param name="request">The request to be processed.</param> private void ProcessArticlePriceRequest(ArticlePriceRequest request) { // Set the underlying XmlObjectStream to send the response on when request.Finish() is called. lock (_syncLock) { if (_messageObjectStream == null) { return; } request.MessageObjectStream = _messageObjectStream; } // Raise the corresponding event. base.Raise("ArticlePriceRequested", _articlePriceRequested, this, request); }
public Task <ArticlePriceResponse> SendRequestAsync(ArticlePriceRequest request, CancellationToken cancellationToken = default) { return(base.SendRequestAsync <ArticlePriceRequest, ArticlePriceResponse>(request, cancellationToken)); }
public ArticlePriceResponse SendRequest(ArticlePriceRequest request) { return(base.SendRequest <ArticlePriceRequest, ArticlePriceResponse>(request)); }
protected void OnRequestReceived(ArticlePriceRequest request) { this.RequestReceived?.Invoke(this, new MessageReceivedEventArgs <ArticlePriceRequest>(request, this.DialogProvider)); }
public ArticlePriceFinishedProcessState(ArticlePriceRequest request, ArticlePriceResponse response) { this.Request = request; this.Response = response; }
public ArticlePriceRequestedProcessState(ArticlePriceWorkflow workflow, ArticlePriceRequest request) { this.Workflow = workflow; this.Request = request; }