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);
            }
        }
        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, 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);
            }
        }
        private static void SerializePointcutTarget(PresentationPointcutTarget target, XmlDocument xmlDoc, XmlNode pointcutNode)
        {
            XmlNode targetNode = xmlDoc.CreateElement("target");

            XmlAttribute sigAttrib = xmlDoc.CreateAttribute("signature");
            sigAttrib.Value = target.Signature;
            targetNode.Attributes.Append(sigAttrib);

            XmlAttribute typeAttrib = xmlDoc.CreateAttribute("type");
            typeAttrib.Value = target.TargetType.ToString().ToLower();
            targetNode.Attributes.Append(typeAttrib);

            if (target.Exclude)
            {
                XmlAttribute exAttrib = xmlDoc.CreateAttribute("exclude");
                exAttrib.Value = "true";
                targetNode.Attributes.Append(exAttrib);
            }

            pointcutNode.AppendChild(targetNode);
        }
        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;
        }
 private void RemovePointcutTarget(PresentationPointcutTarget pointcutTarget)
 {
     pointcutTarget.Pointcut.Targets.Remove(pointcutTarget);
     RefreshAll();
 }
 private void AddPointcutTarget(PresentationPointcut pointcut)
 {
     PresentationPointcutTarget pointcutTarget = new PresentationPointcutTarget(pointcut);
     pointcutTarget.Signature = "[New Pointcut Target]";
     pointcutTarget.TargetType = PointcutTargetType.Signature;
     pointcut.Targets.Add(pointcutTarget);
     RefreshAll();
 }