Beispiel #1
0
        public override void Refresh()
        {
            #region Prune Assemblies

            IList     prune    = new ArrayList();
            Hashtable existing = new Hashtable();
            foreach (Assembly asm in assemblies)
            {
                existing[asm] = asm;
            }

            foreach (TreeNode node in this.Nodes)
            {
                AssemblyNode asmNode = node as AssemblyNode;
                if (asmNode != null)
                {
                    if (!existing.Contains(asmNode.Assembly))
                    {
                        prune.Add(asmNode);
                    }
                }
            }

            foreach (TreeNode pruneNode in prune)
            {
                this.Nodes.Remove(pruneNode);
            }

            #endregion

            #region Add Targets

            IList insert = new ArrayList();
            existing = new Hashtable();

            foreach (TreeNode node in this.Nodes)
            {
                AssemblyNode asmNode = node as AssemblyNode;
                if (asmNode != null)
                {
                    existing[asmNode.Assembly] = asmNode.Assembly;
                }
            }

            foreach (Assembly asm in assemblies)
            {
                if (!existing.Contains(asm))
                {
                    insert.Add(asm);
                }
            }

            foreach (Assembly asm in insert)
            {
                AssemblyNode insertNode = new AssemblyNode(asm, model, aspectMatcher, pointcutMatcher);
                this.Nodes.Add(insertNode);
            }

            #endregion

            base.Refresh();
        }
        public override void Refresh()
        {
            #region Prune Assemblies

            IList prune = new ArrayList();
            Hashtable existing = new Hashtable();
            foreach (Assembly asm in assemblies)
                existing[asm] = asm;

            foreach (TreeNode node in this.Nodes)
            {
                AssemblyNode asmNode = node as AssemblyNode;
                if (asmNode != null)
                {
                    if (!existing.Contains(asmNode.Assembly))
                        prune.Add(asmNode);
                }
            }

            foreach (TreeNode pruneNode in prune)
                this.Nodes.Remove(pruneNode);

            #endregion

            #region Add Targets

            IList insert = new ArrayList();
            existing = new Hashtable();

            foreach (TreeNode node in this.Nodes)
            {
                AssemblyNode asmNode = node as AssemblyNode;
                if (asmNode != null)
                    existing[asmNode.Assembly] = asmNode.Assembly;
            }

            foreach (Assembly asm in assemblies)
                if (!existing.Contains(asm))
                    insert.Add(asm);

            foreach (Assembly asm in insert)
            {
                AssemblyNode insertNode = new AssemblyNode(asm, model, aspectMatcher, pointcutMatcher);
                this.Nodes.Add(insertNode);
            }

            #endregion

            base.Refresh();
        }