summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.Messaging/Messaging/OutgoingWebResponse.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2011-09-17 17:19:26 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2011-09-17 17:19:26 -0700
commitbab1c76d35421a3d2a1608e6f3e66d67b4fbdb09 (patch)
treecc27e38eb52d26bb2a977b2d0335f0f04a23c746 /src/DotNetOpenAuth.Messaging/Messaging/OutgoingWebResponse.cs
parent344c333ecd76785a77b8a1a56e1bc360ae159d04 (diff)
downloadDotNetOpenAuth-bab1c76d35421a3d2a1608e6f3e66d67b4fbdb09.zip
DotNetOpenAuth-bab1c76d35421a3d2a1608e6f3e66d67b4fbdb09.tar.gz
DotNetOpenAuth-bab1c76d35421a3d2a1608e6f3e66d67b4fbdb09.tar.bz2
DotNetOpenAuth.Messaging no longer relies on ccrewrite.exe
Diffstat (limited to 'src/DotNetOpenAuth.Messaging/Messaging/OutgoingWebResponse.cs')
-rw-r--r--src/DotNetOpenAuth.Messaging/Messaging/OutgoingWebResponse.cs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/DotNetOpenAuth.Messaging/Messaging/OutgoingWebResponse.cs b/src/DotNetOpenAuth.Messaging/Messaging/OutgoingWebResponse.cs
index b4bc22d..b48ab5e 100644
--- a/src/DotNetOpenAuth.Messaging/Messaging/OutgoingWebResponse.cs
+++ b/src/DotNetOpenAuth.Messaging/Messaging/OutgoingWebResponse.cs
@@ -51,7 +51,7 @@ namespace DotNetOpenAuth.Messaging {
/// <param name="response">The <see cref="HttpWebResponse"/> to clone.</param>
/// <param name="maximumBytesToRead">The maximum bytes to read from the response stream.</param>
protected internal OutgoingWebResponse(HttpWebResponse response, int maximumBytesToRead) {
- Contract.Requires<ArgumentNullException>(response != null);
+ Requires.NotNull(response, "response");
this.Status = response.StatusCode;
this.Headers = response.Headers;
@@ -128,7 +128,7 @@ namespace DotNetOpenAuth.Messaging {
/// </remarks>
[EditorBrowsable(EditorBrowsableState.Never), Obsolete("Use the Respond method instead, and prepare for execution to continue on this page beyond the call to Respond.")]
public virtual void Send() {
- Contract.Requires<InvalidOperationException>(HttpContext.Current != null && HttpContext.Current.Request != null, MessagingStrings.HttpContextRequired);
+ Requires.ValidState(HttpContext.Current != null && HttpContext.Current.Request != null, MessagingStrings.HttpContextRequired);
this.Send(HttpContext.Current);
}
@@ -154,7 +154,7 @@ namespace DotNetOpenAuth.Messaging {
/// Requires a current HttpContext.
/// </remarks>
public virtual void Respond() {
- Contract.Requires<InvalidOperationException>(HttpContext.Current != null && HttpContext.Current.Request != null, MessagingStrings.HttpContextRequired);
+ Requires.ValidState(HttpContext.Current != null && HttpContext.Current.Request != null, MessagingStrings.HttpContextRequired);
this.Respond(HttpContext.Current);
}
@@ -167,7 +167,7 @@ namespace DotNetOpenAuth.Messaging {
/// <param name="context">The context of the HTTP request whose response should be set.
/// Typically this is <see cref="HttpContext.Current"/>.</param>
public virtual void Respond(HttpContext context) {
- Contract.Requires<ArgumentNullException>(context != null);
+ Requires.NotNull(context, "context");
this.Respond(context, false);
}
@@ -177,7 +177,7 @@ namespace DotNetOpenAuth.Messaging {
/// </summary>
/// <param name="response">The response to set to this message.</param>
public virtual void Send(HttpListenerResponse response) {
- Contract.Requires<ArgumentNullException>(response != null);
+ Requires.NotNull(response, "response");
response.StatusCode = (int)this.Status;
MessagingUtilities.ApplyHeadersToResponse(this.Headers, response);
@@ -203,7 +203,7 @@ namespace DotNetOpenAuth.Messaging {
/// rather than cause a redirect.
/// </remarks>
internal Uri GetDirectUriRequest(Channel channel) {
- Contract.Requires<ArgumentNullException>(channel != null);
+ Requires.NotNull(channel, "channel");
var message = this.OriginalMessage as IDirectedProtocolMessage;
if (message == null) {
@@ -255,7 +255,7 @@ namespace DotNetOpenAuth.Messaging {
/// <see cref="HttpApplication.CompleteRequest"/> rather than <see cref="HttpResponse.End"/>
/// to avoid a <see cref="ThreadAbortException"/>.</param>
protected internal virtual void Respond(HttpContext context, bool endRequest) {
- Contract.Requires<ArgumentNullException>(context != null);
+ Requires.NotNull(context, "context");
context.Response.Clear();
context.Response.StatusCode = (int)this.Status;