|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using MvcCallInterceptors.Controllers;
using System.Reflection;
namespace MvcCallInterceptors.Interceptors
{
public class ActionInterceptor
{
Type _interceptorControllerType;
ActionInterceptorAttribute _actionInterceptorProperties;
internal MethodInfo InterceptorMethodInfo;
public ActionInterceptor(Type interceptorControllerType, ActionInterceptorAttribute actionInterceptorProperties, MethodInfo interceptorMethodInfo)
{
if (interceptorControllerType == null || actionInterceptorProperties == null || interceptorMethodInfo == null)
{
throw new Exception("Failed to initialize required parameters for ActionInterceptor");
}
_interceptorControllerType = interceptorControllerType;
_actionInterceptorProperties = actionInterceptorProperties;
InterceptorMethodInfo = interceptorMethodInfo;
}
public Type InterceptorControllerType
{
get { return _interceptorControllerType; }
}
public ActionInterceptorAttribute ActionInterceptorProperties
{
get { return _actionInterceptorProperties; }
}
public override bool Equals(object obj)
{
var actionInterceptor = obj as ActionInterceptor;
if (actionInterceptor == null )
return false;
return new ActionInterceptorComparer().Equals(this, actionInterceptor);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.