PageRenderTime 4ms CodeModel.GetById 2ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/src/LinFu.AOP.Interfaces/IFieldInterceptor.cs

http://github.com/philiplaureano/LinFu
C# | 30 lines | 9 code | 2 blank | 19 comment | 0 complexity | d89797e9867d84f614283722bc66bfdf MD5 | raw file
 1namespace LinFu.AOP.Interfaces
 2{
 3    /// <summary>
 4    ///     Represents a type that can intercept field getter and setter calls.
 5    /// </summary>
 6    public interface IFieldInterceptor
 7    {
 8        /// <summary>
 9        ///     Determines whether or not a field can be intercepted.
10        /// </summary>
11        /// <param name="context">The context that describes the field to be intercepted.</param>
12        /// <returns><c>true</c> if it can be intercepted; otherwise, it will return <c>false</c>.</returns>
13        bool CanIntercept(IFieldInterceptionContext context);
14
15        /// <summary>
16        ///     Gets the value of a field.
17        /// </summary>
18        /// <param name="context">The context that describes the field to be intercepted.</param>
19        /// <returns>The value of the target field.</returns>
20        object GetValue(IFieldInterceptionContext context);
21
22        /// <summary>
23        ///     Sets the value of a field.
24        /// </summary>
25        /// <param name="context">The context that describes the field to be intercepted.</param>
26        /// <param name="value">The original value that will be assigned to the target field.</param>
27        /// <returns>The value that will be assigned to the target field.</returns>
28        object SetValue(IFieldInterceptionContext context, object value);
29    }
30}