public PresentationPointcut(PresentationAspect aspect, IPointcut pointcut)
        {
            this.aspect = aspect;

            this.Name = pointcut.Name;

            foreach (PointcutTarget target in pointcut.Targets)
            {
                PresentationPointcutTarget presTarget = new PresentationPointcutTarget(this, target);
                this.Targets.Add(presTarget);
            }

            foreach (object interceptor in pointcut.Interceptors)
            {
                string typeName = "";
                if (interceptor is Type)
                {
                    typeName = ((Type)interceptor).FullName;
                }
                else
                {
                    typeName = (string)interceptor;
                }

                PresentationInterceptor presInterceptor = new PresentationInterceptor(this, typeName);
                this.Interceptors.Add(presInterceptor);
            }
        }
        public PresentationAspectTarget(PresentationAspect aspect, AspectTarget target)
        {
            this.Aspect = aspect;

            this.Exclude    = target.Exclude;
            this.Signature  = target.Signature;
            this.TargetType = target.TargetType;
        }
Exemplo n.º 3
0
        public static PresentationModel CreatePresentationModel(IEngine engine)
        {
            PresentationModel model = new PresentationModel();

            foreach (IGenericAspect aspect in engine.Configuration.Aspects)
            {
                PresentationAspect presAspect = new PresentationAspect(aspect);
                model.Aspects.Add(presAspect);
            }

            return(model);
        }
        private PresentationPointcutTarget AddFullSignatureTarget(Type type, string fullSignature)
        {
            PresentationAspect aspect = this.Aspect;

            aspect.AddTypeTarget(type);

            foreach (PresentationPointcutTarget target in this.Targets)
            {
                if (target.TargetType == PointcutTargetType.FullSignature)
                {
                    if (target.Signature == fullSignature)
                    {
                        return(target);
                    }
                }
            }

            PresentationPointcutTarget newTarget = new PresentationPointcutTarget(this);

            newTarget.TargetType = PointcutTargetType.FullSignature;
            newTarget.Signature  = fullSignature;
            this.Targets.Add(newTarget);
            return(newTarget);
        }
 public PresentationPointcut(PresentationAspect aspect)
 {
     this.aspect = aspect;
 }
 public PresentationAspectTarget(PresentationAspect aspect)
 {
     this.Aspect = aspect;
 }