コード例 #1
0
        public AssemblyListNode(IList assemblies, PresentationModel model, AspectMatcher aspectMatcher, PointcutMatcher pointcutMatcher)
            : base("Assemblies")
        {
            this.assemblies      = assemblies;
            this.model           = model;
            this.aspectMatcher   = aspectMatcher;
            this.pointcutMatcher = pointcutMatcher;

            this.ImageIndex         = 12;
            this.SelectedImageIndex = 12;

            ArrayList sortedAssemblies = new ArrayList(assemblies);

            sortedAssemblies.Sort(new AssemblyComparer());
            foreach (Assembly asm in sortedAssemblies)
            {
                this.Nodes.Add(new AssemblyNode(asm, model, aspectMatcher, pointcutMatcher));
            }
        }
コード例 #2
0
        public TypeNode(Type type, PresentationModel model, AspectMatcher aspectMatcher, PointcutMatcher pointcutMatcher)
            : base(type.FullName)
        {
            this.type            = type;
            this.model           = model;
            this.aspectMatcher   = aspectMatcher;
            this.pointcutMatcher = pointcutMatcher;

            this.ImageIndex         = 1;
            this.SelectedImageIndex = 1;

            ArrayList aspects = null;

            if (model != null)
            {
                aspects = (ArrayList)aspectMatcher.MatchAspectsForType(type, model.Aspects);

                foreach (PresentationAspect aspect in aspects)
                {
                    aspect.AppliedOnTypes.Add(type);
                }

                if (aspects.Count > 0)
                {
                    this.ImageIndex         = 9;
                    this.SelectedImageIndex = 9;
                }

                //Order is important....
                //aspects.Sort(new AspectComparer());
                foreach (IGenericAspect aspect in aspects)
                {
                    TreeNode aspectNode = new AspectNode(aspect);
                    this.Nodes.Add(aspectNode);
                }
            }

            ArrayList ctors = new ArrayList(type.GetConstructors());

            ctors.Sort(new MethodComparer());
            foreach (MethodBase method in ctors)
            {
                TreeNode methodNode = new MethodNode(this.Type, method, aspects, model, pointcutMatcher);
                this.Nodes.Add(methodNode);
            }

            ArrayList methods = new ArrayList(type.GetMethods());

            methods.Sort(new MethodComparer());
            foreach (MethodBase method in methods)
            {
                if (!method.IsStatic)
                {
                    TreeNode methodNode = new MethodNode(this.Type, method, aspects, model, pointcutMatcher);
                    this.Nodes.Add(methodNode);
                }
            }
        }
コード例 #3
0
        public static void SetupAspectTreeView(TreeView treeView, IList assemblies, PresentationModel model, AspectMatcher aspectMatcher, PointcutMatcher pointcutMatcher)
        {
            treeView.Nodes.Clear();

            treeView.Nodes.Add(new ConfigurationNode(model));
        }
コード例 #4
0
        public static void SetupProjectTreeView(TreeView treeView, IList assemblies, PresentationModel model, AspectMatcher aspectMatcher, PointcutMatcher pointcutMatcher)
        {
            treeView.Nodes.Clear();

            AssemblyListNode node = new AssemblyListNode(assemblies, model, aspectMatcher, pointcutMatcher);

            treeView.Nodes.Add(node);
        }
コード例 #5
0
        public MethodNode(Type type, MethodBase method, IList aspects, PresentationModel model, PointcutMatcher pointcutMatcher)
            : base(AopTools.GetMethodSignature(method))
        {
            this.type            = type;
            this.method          = method;
            this.aspects         = aspects;
            this.model           = model;
            this.pointcutMatcher = pointcutMatcher;

            this.ImageIndex         = 2;
            this.SelectedImageIndex = 2;

            if (CanBeProxied())
            {
                if (aspects != null)
                {
                    if (ShouldProxy())
                    {
                        AddInterceptorNodes();
                    }
                }
            }
            else
            {
                this.ImageIndex         = 13;
                this.SelectedImageIndex = 13;
            }
        }
コード例 #6
0
        public AssemblyNode(Assembly assembly, PresentationModel model, AspectMatcher aspectMatcher, PointcutMatcher pointcutMatcher)
            : base(assembly.GetName().Name)
        {
            this.Assembly = assembly;

            ArrayList types = new ArrayList(assembly.GetTypes());

            types.Sort(new TypeComparer());
            foreach (Type type in types)
            {
                if (type.IsClass)
                {
                    TreeNode node = new TypeNode(type, model, aspectMatcher, pointcutMatcher);
                    this.Nodes.Add(node);
                }
            }
        }