//----------------------------------------------------------------------- // // Copyright (c) Outercurve Foundation. All rights reserved. // //----------------------------------------------------------------------- namespace DotNetOpenAuth.Test.Mocks { using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using DotNetOpenAuth.Messaging; using Validation; internal class CoordinatingOutgoingWebResponse : OutgoingWebResponse { private CoordinatingChannel receivingChannel; private CoordinatingChannel sendingChannel; /// /// Initializes a new instance of the class. /// /// The direct response message to send to the remote channel. This message will be cloned. /// The receiving channel. /// The sending channel. internal CoordinatingOutgoingWebResponse(IProtocolMessage message, CoordinatingChannel receivingChannel, CoordinatingChannel sendingChannel) { Requires.NotNull(message, "message"); Requires.NotNull(receivingChannel, "receivingChannel"); Requires.NotNull(sendingChannel, "sendingChannel"); this.receivingChannel = receivingChannel; this.sendingChannel = sendingChannel; this.OriginalMessage = message; } [EditorBrowsable(EditorBrowsableState.Never)] public override void Send() { this.Respond(); } public override void Respond() { this.sendingChannel.SaveCookies(this.Cookies); this.receivingChannel.PostMessage(this.OriginalMessage); } } }