diff options
3 files changed, 32 insertions, 9 deletions
diff --git a/src/DotNetOAuth.Test/Mocks/TestDirectedMessage.cs b/src/DotNetOAuth.Test/Mocks/TestDirectedMessage.cs index 30a290d..7add28b 100644 --- a/src/DotNetOAuth.Test/Mocks/TestDirectedMessage.cs +++ b/src/DotNetOAuth.Test/Mocks/TestDirectedMessage.cs @@ -32,7 +32,7 @@ namespace DotNetOAuth.Test.Mocks { #endregion
- #region IProtocolMessage Members
+ #region IProtocolMessage Properties
Version IProtocolMessage.ProtocolVersion {
get { return new Version(1, 0); }
@@ -46,6 +46,14 @@ namespace DotNetOAuth.Test.Mocks { get { return this.transport; }
}
+ #endregion
+
+ protected virtual MessageProtection RequiredProtection {
+ get { return MessageProtection.None; }
+ }
+
+ #region IProtocolMessage Methods
+
void IProtocolMessage.EnsureValidMessage() {
if (this.EmptyMember != null || this.Age < 0) {
throw new ProtocolException();
@@ -53,9 +61,5 @@ namespace DotNetOAuth.Test.Mocks { }
#endregion
-
- protected virtual MessageProtection RequiredProtection {
- get { return MessageProtection.None; }
- }
}
}
diff --git a/src/DotNetOAuth/Messaging/Bindings/StandardExpirationBindingElement.cs b/src/DotNetOAuth/Messaging/Bindings/StandardExpirationBindingElement.cs index ef93e0d..25a24f5 100644 --- a/src/DotNetOAuth/Messaging/Bindings/StandardExpirationBindingElement.cs +++ b/src/DotNetOAuth/Messaging/Bindings/StandardExpirationBindingElement.cs @@ -71,6 +71,10 @@ namespace DotNetOAuth.Messaging.Bindings { /// Sets the timestamp on an outgoing message.
/// </summary>
/// <param name="message">The outgoing message.</param>
+ /// <returns>
+ /// True if the <paramref name="message"/> applied to this binding element
+ /// and the operation was successful. False otherwise.
+ /// </returns>
bool IChannelBindingElement.PrepareMessageForSending(IProtocolMessage message) {
IExpiringProtocolMessage expiringMessage = message as IExpiringProtocolMessage;
if (expiringMessage != null) {
@@ -85,7 +89,15 @@ namespace DotNetOAuth.Messaging.Bindings { /// Reads the timestamp on a message and throws an exception if the message is too old.
/// </summary>
/// <param name="message">The incoming message.</param>
+ /// <returns>
+ /// True if the <paramref name="message"/> applied to this binding element
+ /// and the operation was successful. False if the operation did not apply to this message.
+ /// </returns>
/// <exception cref="ExpiredMessageException">Thrown if the given message has already expired.</exception>
+ /// <exception cref="ProtocolException">
+ /// Thrown when the binding element rules indicate that this message is invalid and should
+ /// NOT be processed.
+ /// </exception>
bool IChannelBindingElement.PrepareMessageForReceiving(IProtocolMessage message) {
IExpiringProtocolMessage expiringMessage = message as IExpiringProtocolMessage;
if (expiringMessage != null) {
diff --git a/src/DotNetOAuth/Messaging/UnprotectedMessageException.cs b/src/DotNetOAuth/Messaging/UnprotectedMessageException.cs index f05bf88..45a6a41 100644 --- a/src/DotNetOAuth/Messaging/UnprotectedMessageException.cs +++ b/src/DotNetOAuth/Messaging/UnprotectedMessageException.cs @@ -1,10 +1,17 @@ -namespace DotNetOAuth.Messaging {
+//-----------------------------------------------------------------------
+// <copyright file="UnprotectedMessageException.cs" company="Andrew Arnott">
+// Copyright (c) Andrew Arnott. All rights reserved.
+// </copyright>
+//-----------------------------------------------------------------------
+
+namespace DotNetOAuth.Messaging {
using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
using System.Globalization;
+ /// <summary>
+ /// An exception thrown when messages cannot receive all the protections they require.
+ /// </summary>
+ [Serializable]
internal class UnprotectedMessageException : ProtocolException {
/// <summary>
/// Initializes a new instance of the <see cref="UnprotectedMessageException"/> class.
|