public override void BuildChildNodes (ITreeBuilder treeBuilder, object dataObject)
		{
			var compilationUnit = (AssemblyLoader)dataObject;
			
			var references = new AssemblyReferenceFolder (compilationUnit.Assembly);
			if (references.AssemblyReferences.Any () || references.ModuleReferences.Any ())
				treeBuilder.AddChild (references);
			
			var resources = new AssemblyResourceFolder (compilationUnit.Assembly);
			if (resources.Resources.Any ())
				treeBuilder.AddChild (resources);
			
			var namespaces = new Dictionary<string, Namespace> ();
			bool publicOnly = Widget.PublicApiOnly;
			
			foreach (var type in compilationUnit.UnresolvedAssembly.TopLevelTypeDefinitions) {
				string namespaceName = string.IsNullOrEmpty (type.Namespace) ? "-" : type.Namespace;
				if (!namespaces.ContainsKey (namespaceName))
					namespaces [namespaceName] = new Namespace (namespaceName);
				
				var ns = namespaces [namespaceName];
				ns.Types.Add (type);
			}
			
			foreach (var ns in namespaces.Values) {
				if (publicOnly && !ns.Types.Any (t => t.IsPublic))
					continue;
				treeBuilder.AddChild (ns);
			}
		}
Exemplo n.º 2
0
		public override void BuildChildNodes (ITreeBuilder builder, object dataObject)
		{
			var project = (Project)dataObject;
			var ctx = TypeSystemService.GetProjectContext (project);
			if (ctx == null)
				return;
			
			var namespaces = new Dictionary<string, Namespace> ();
			bool publicOnly = Widget.PublicApiOnly;
			
			foreach (var type in ctx.TopLevelTypeDefinitions) {
				string namespaceName = string.IsNullOrEmpty (type.Namespace) ? "-" : type.Namespace;
				if (!namespaces.ContainsKey (namespaceName))
					namespaces [namespaceName] = new Namespace (namespaceName);
				
				var ns = namespaces [namespaceName];
				ns.Types.Add (type);
			}
			
			foreach (var ns in namespaces.Values) {
				builder.AddChild (ns);
			}
		}
Exemplo n.º 3
0
        public override string GetNodeName(ITreeNavigator thisNode, object dataObject)
        {
            Namespace ns = (Namespace)dataObject;

            return(ns.Name);
        }