Browse files

interception xmldoc

  • Loading branch information...
1 parent 2dcb53d commit c3ed40ea4242e4a4cf3c0e6a86abd19e5b319693 @adrianaisemberg adrianaisemberg committed Oct 31, 2011
View
9 CLAP/Interception/IVerbInterceptor.cs
@@ -1,15 +1,24 @@
namespace CLAP.Interception
{
+ /// <summary>
+ /// Gives interception options to verb execution
+ /// </summary>
public interface IVerbInterceptor : IPreVerbInterceptor, IPostVerbInterceptor
{
}
+ /// <summary>
+ /// Gives interception options to verb execution BEFORE the verb is executed
+ /// </summary>
public interface IPreVerbInterceptor
{
void Intercept(PreVerbExecutionContext context);
}
+ /// <summary>
+ /// Gives interception options to verb execution AFTER the verb is executed, even if the execution fails
+ /// </summary>
public interface IPostVerbInterceptor
{
void Intercept(PostVerbExecutionContext context);
View
12 CLAP/Interception/ParameterAndValue.cs
@@ -1,12 +1,22 @@
namespace CLAP.Interception
{
+ /// <summary>
+ /// A parameter and its value
+ /// </summary>
public sealed class ParameterAndValue
{
+ /// <summary>
+ /// The parameter
+ /// </summary>
public Parameter Parameter { get; private set; }
+
+ /// <summary>
+ /// The value of the parameter
+ /// </summary>
public object Value { get; private set; }
- public ParameterAndValue(Parameter parameter, object value)
+ internal ParameterAndValue(Parameter parameter, object value)
{
Parameter = parameter;
Value = value;
View
3 CLAP/Interception/PostVerbExecutionAttribute.cs
@@ -2,6 +2,9 @@
namespace CLAP.Interception
{
+ /// <summary>
+ /// Marks a method to run after each verb is executed
+ /// </summary>
[Serializable]
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
public sealed class PostVerbExecutionAttribute : Attribute
View
13 CLAP/Interception/PostVerbExecutionContext.cs
@@ -3,13 +3,26 @@
namespace CLAP.Interception
{
+ /// <summary>
+ /// The context after a verb was executed
+ /// </summary>
public sealed class PostVerbExecutionContext : VerbExecutionContext
{
#region Properties
+ /// <summary>
+ /// Whether the verb execution was cancelled by the pre-execution interception
+ /// </summary>
public bool Cancelled { get; private set; }
+
+ /// <summary>
+ /// If the verb failed to execute - this contains the exception that was thrown
+ /// </summary>
public Exception Exception { get; private set; }
+ /// <summary>
+ /// Whether the verb failed to execute
+ /// </summary>
public bool Failed
{
get { return Exception != null; }
View
3 CLAP/Interception/PreVerbExecutionAttribute.cs
@@ -2,6 +2,9 @@
namespace CLAP.Interception
{
+ /// <summary>
+ /// Marks a method to run before each verb is executed
+ /// </summary>
[Serializable]
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
public sealed class PreVerbExecutionAttribute : Attribute
View
7 CLAP/Interception/PreVerbExecutionContext.cs
@@ -2,10 +2,17 @@
namespace CLAP.Interception
{
+ /// <summary>
+ /// The context before a verb is to be executed
+ /// </summary>
public sealed class PreVerbExecutionContext : VerbExecutionContext
{
#region Properties
+ /// <summary>
+ /// Whether to cancel to verb execution.
+ /// The post-interception will be called having the Cancelled property set to true.
+ /// </summary>
public bool Cancel { get; set; }
#endregion Properties
View
20 CLAP/Interception/VerbExecutionContext.cs
@@ -2,11 +2,31 @@
namespace CLAP.Interception
{
+ /// <summary>
+ /// A verb execution context
+ /// </summary>
public abstract class VerbExecutionContext
{
+ /// <summary>
+ /// The method that is executed
+ /// </summary>
public Method Method { get; private set; }
+
+ /// <summary>
+ /// The target object, if any, that the verb is executed on.
+ /// If the verb is static, this is null.
+ /// </summary>
public object Target { get; private set; }
+
+ /// <summary>
+ /// The list of parameters and their values
+ /// </summary>
public ParameterAndValue[] Parameters { get; private set; }
+
+ /// <summary>
+ /// A user-context that can be filled with custom keys and values.
+ /// Once filled in the pre-execution context - it is available in the post-execution context.
+ /// </summary>
public Dictionary<object, object> UserContext { get; private set; }
protected VerbExecutionContext(
View
12 CLAP/Interception/VerbInterception.cs
@@ -2,12 +2,24 @@
namespace CLAP.Interception
{
+ /// <summary>
+ /// Marks a class to allow verb-interception by a defined IVerbInterceptor
+ /// (or either IPreVerbInterceptor or IPostVerbInterceptor) type
+ /// </summary>
[Serializable]
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
public sealed class VerbInterception : Attribute
{
+ /// <summary>
+ /// The interceptor type
+ /// </summary>
public Type InterceptorType { get; private set; }
+ /// <summary>
+ /// Marks a class to allow verb-interception by a defined IVerbInterceptor
+ /// (or either IPreVerbInterceptor or IPostVerbInterceptor) type
+ /// </summary>
+ /// <param name="interceptorType">An interceptor type that implements either IVerbInterceptor, IPreVerbInterceptor or IPostVerbInterceptor</param>
public VerbInterception(Type interceptorType)
{
InterceptorType = interceptorType;

0 comments on commit c3ed40e

Please sign in to comment.