示例#1
0
        private static IPointcutProvider CreatePointcutProvider(string pointcutName, PointcutExpression pointcut)
        {
            var type = typeof(SelectMethodsAttribute).Assembly.GetType(typeof(SelectMethodsAttribute).Namespace + "." + pointcut.AttributeName + "Attribute");

            if (type == null)
            {
                throw new QueryParsingException(pointcutName, pointcut, "Unrecognized pointcut attribute: " + pointcut.AttributeName);
            }

            return((IPointcutProvider)Activator.CreateInstance(type, new object[] { pointcut.Saql }));
        }
示例#2
0
 private static IPointcut RegisterPointcut(PointcutExpression pointcutExpression, string pointcutName, AspectDefinition aspect)
 {
     try
     {
         return(CreatePointcutProvider(pointcutName, pointcutExpression).RegisterPointcut(aspect, pointcutName));
     }
     catch (Exception e)
     {
         throw new QueryParsingException(pointcutName, pointcutExpression, e);
     }
 }