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); }
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); } } }
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); } } }
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)); }
public static void SetupAspectTreeView(TreeView treeView, IList assemblies, PresentationModel model, AspectMatcher aspectMatcher, PointcutMatcher pointcutMatcher) { treeView.Nodes.Clear(); treeView.Nodes.Add(new ConfigurationNode(model)); }