public override void BuildChildNodes(ITreeBuilder builder, object dataObject)
        {
            if (!builder.Options ["ShowAllFiles"])
            {
                return;
            }

            string path = GetFolderPath(dataObject);

            if (Directory.Exists(path))
            {
                Project project = (Project)builder.GetParentDataItem(typeof(Project), true);
                SolutionFolderFileCollection folderFiles = null;
                if (dataObject is Solution)
                {
                    folderFiles = ((Solution)dataObject).RootFolder.Files;
                }
                else if (dataObject is SolutionFolder)
                {
                    folderFiles = ((SolutionFolder)dataObject).Files;
                }

                builder.AddChildren(Directory.EnumerateFiles(path)
                                    .Where(file => (project == null || project.Files.GetFile(file) == null) && (folderFiles == null || !folderFiles.Contains(file)))
                                    .Select(file => new SystemFile(file, project)));

                builder.AddChildren(Directory.EnumerateDirectories(path)
                                    .Where(folder => !builder.HasChild(Path.GetFileName(folder), typeof(ProjectFolder)))
                                    .Select(folder => new ProjectFolder(folder, project)));
            }
        }
Exemple #2
0
        void AddProjectContent(ITreeBuilder builder, List <IMember> list)
        {
            bool nestedNs   = builder.Options ["NestedNamespaces"];
            bool publicOnly = builder.Options ["PublicApiOnly"];

            foreach (IMember ob in list)
            {
                if (ob is Namespace && nestedNs)
                {
                    Namespace nsob = (Namespace)ob;
                    string    ns   = FullName + "." + nsob.Name;
                    if (!builder.HasChild(nsob.Name, typeof(NamespaceData)))
                    {
                        builder.AddChild(new ProjectNamespaceData(project, ns));
                    }
                }
                else if (ob is IType)
                {
                    if (!publicOnly || ((IType)ob).IsPublic)
                    {
                        builder.AddChild(new ClassData(project, ob as IType));
                    }
                }
            }
        }
        public override void BuildChildNodes(ITreeBuilder builder, object dataObject)
        {
            string path = GetFolderPath(dataObject);

            if (builder.Options ["ShowAllFiles"] && Directory.Exists(path))
            {
                Project project = (Project)builder.GetParentDataItem(typeof(Project), true);
                SolutionFolderFileCollection folderFiles = null;
                if (dataObject is Solution)
                {
                    folderFiles = ((Solution)dataObject).RootFolder.Files;
                }
                else if (dataObject is SolutionFolder)
                {
                    folderFiles = ((SolutionFolder)dataObject).Files;
                }

                foreach (string file in Directory.GetFiles(path))
                {
                    if ((project == null || project.Files.GetFile(file) == null) && (folderFiles == null || !folderFiles.Contains(file)))
                    {
                        builder.AddChild(new SystemFile(file, project));
                    }
                }

                foreach (string folder in Directory.GetDirectories(path))
                {
                    if (!builder.HasChild(Path.GetFileName(folder), typeof(ProjectFolder)))
                    {
                        builder.AddChild(new ProjectFolder(folder, project));
                    }
                }
            }
        }
        public static void FillNamespaces(ITreeBuilder builder, Project project, string ns)
        {
            ProjectDom     dom     = ProjectDomService.GetProjectDom(project);
            List <IMember> members = dom.GetNamespaceContents(ns, false, false);

            //IParserContext ctx = IdeApp.Workspace.ParserDatabase.GetProjectParserContext (project);
            if (members.Count > 0)
            {
                if (builder.Options ["ShowProjects"])
                {
                    builder.AddChild(new ProjectNamespaceData(project, ns));
                }
                else
                {
                    if (!builder.HasChild(ns, typeof(NamespaceData)))
                    {
                        builder.AddChild(new ProjectNamespaceData(null, ns));
                    }
                }
            }
            foreach (IMember ob in members)
            {
                if (ob is Namespace)
                {
                    FillNamespaces(builder, project, ns + "." + ((Namespace)ob).Name);
                }
            }
        }
Exemple #5
0
        void AddProjectContent(ITreeBuilder builder, Project p)
        {
            builder.AddChildren(namesp.GetNamespaceMembers()
                                .Where(ns => !builder.HasChild(ns.Name, typeof(NamespaceData)))
                                .Select(ns => new ProjectNamespaceData(project, ns)));
            //			bool nestedNs = builder.Options ["NestedNamespaces"];
            bool publicOnly = builder.Options ["PublicApiOnly"];

            builder.AddChildren(namesp.GetAllTypes()
                                .Where(type => !publicOnly || type.DeclaredAccessibility == Accessibility.Public)
                                .Select(type => new ClassData(project, type)));
        }
        public override void BuildChildNodes(ITreeBuilder builder, object dataObject)
        {
            string path = GetFolderPath (dataObject);
            if (builder.Options ["ShowAllFiles"] && Directory.Exists (path))
            {
                Project project = (Project) builder.GetParentDataItem (typeof(Project), true);

                foreach (string file in Directory.GetFiles (path)) {
                    if (project.ProjectFiles.GetFile (file) == null)
                        builder.AddChild (new SystemFile (file, project));
                }

                foreach (string folder in Directory.GetDirectories (path))
                    if (!builder.HasChild (Path.GetFileName (folder), typeof(ProjectFolder)))
                        builder.AddChild (new ProjectFolder (folder, project));
            }
        }
        void AddProjectContent(ITreeBuilder builder, Project p)
        {
            foreach (var ns in namesp.GetNamespaceMembers())
            {
                if (!builder.HasChild(ns.Name, typeof(NamespaceData)))
                {
                    builder.AddChild(new ProjectNamespaceData(project, ns));
                }
            }
            //			bool nestedNs = builder.Options ["NestedNamespaces"];
            bool publicOnly = builder.Options ["PublicApiOnly"];

            foreach (var type in namesp.GetAllTypes())
            {
                if (!publicOnly || type.DeclaredAccessibility == Accessibility.Public)
                {
                    builder.AddChild(new ClassData(project, type));
                }
            }
        }
Exemple #8
0
        void AddProjectContent(ITreeBuilder builder, Project p)
        {
            foreach (var ns in namesp.ChildNamespaces)
            {
                if (!builder.HasChild(ns.Name, typeof(NamespaceData)))
                {
                    builder.AddChild(new ProjectNamespaceData(project, ns));
                }
            }
//			bool nestedNs = builder.Options ["NestedNamespaces"];
            bool publicOnly = builder.Options ["PublicApiOnly"];

            foreach (var type in namesp.Types)
            {
                if (!publicOnly || type.IsPublic)
                {
                    builder.AddChild(new ClassData(project, type));
                }
            }
        }
Exemple #9
0
        public static void FillNamespaces(ITreeBuilder builder, Project project, INamespace ns)
        {
            var members = ns.Types;

            //IParserContext ctx = IdeApp.Workspace.ParserDatabase.GetProjectParserContext (project);
            if (members.Any())
            {
                if (builder.Options ["ShowProjects"])
                {
                    builder.AddChild(new ProjectNamespaceData(project, ns));
                }
                else
                {
                    if (!builder.HasChild(ns.Name, typeof(NamespaceData)))
                    {
                        builder.AddChild(new ProjectNamespaceData(null, ns));
                    }
                }
            }
            foreach (var nSpace in ns.ChildNamespaces)
            {
                FillNamespaces(builder, project, nSpace);
            }
        }
Exemple #10
0
		void AddProjectContent (ITreeBuilder builder, Project p)
		{
			foreach (var ns in namesp.GetNamespaceMembers ()) {
				if (!builder.HasChild (ns.Name, typeof (NamespaceData)))
					builder.AddChild (new ProjectNamespaceData (project, ns));
			}
			//			bool nestedNs = builder.Options ["NestedNamespaces"];
			bool publicOnly = builder.Options ["PublicApiOnly"];

			foreach (var type in namesp.GetAllTypes ()) {
				if (!publicOnly || type.DeclaredAccessibility == Accessibility.Public)
					builder.AddChild (new ClassData (project, type));
			}
		}
		public static void FillNamespaces (ITreeBuilder builder, Project project, INamespace ns)
		{
			var members = ns.Types;
			//IParserContext ctx = IdeApp.Workspace.ParserDatabase.GetProjectParserContext (project);
			if (members.Any ()) {
				if (builder.Options ["ShowProjects"])
					builder.AddChild (new ProjectNamespaceData (project, ns));
				else {
					if (!builder.HasChild (ns.Name, typeof (NamespaceData)))
						builder.AddChild (new ProjectNamespaceData (null, ns));
				}
			}
			foreach (var nSpace in ns.ChildNamespaces) {
				FillNamespaces (builder, project, nSpace);
			}
		}
Exemple #12
0
		void AddProjectContent (ITreeBuilder builder, Project p)
		{
			foreach (var ns in namesp.ChildNamespaces) {
				if (!builder.HasChild (ns.Name, typeof(NamespaceData)))
					builder.AddChild (new ProjectNamespaceData (project, ns));
			}
			bool nestedNs = builder.Options ["NestedNamespaces"];
			bool publicOnly = builder.Options ["PublicApiOnly"];
			
			foreach (var type in namesp.Types) {
				if (!publicOnly || type.IsPublic)
					builder.AddChild (new ClassData (project, type));
			}
			
		}
        public static void FillNamespaces(ITreeBuilder builder, Project project, string ns)
        {
            IParserContext ctx = Runtime.ProjectService.ParserDatabase.GetProjectParserContext (project);
            if (ctx.GetClassList (ns, false, true).Length > 0) {
                if (builder.Options ["ShowProjects"])
                    builder.AddChild (new NamespaceData (project, ns));
                else {
                    if (!builder.HasChild (ns, typeof (NamespaceData)))
                        builder.AddChild (new NamespaceData (null, ns));
                }
            }

            string[] list = ctx.GetNamespaceList (ns, false, true);
            foreach (string subns in list)
                FillNamespaces (builder, project, ns + "." + subns);
        }
		public override void BuildChildNodes (ITreeBuilder builder, object dataObject)
		{
			if (!builder.Options ["ShowAllFiles"])
				return;

			string path = GetFolderPath (dataObject);
			if (Directory.Exists (path))
			{
				Project project = (Project) builder.GetParentDataItem (typeof(Project), true);
				SolutionFolderFileCollection folderFiles = null;
				if (dataObject is Solution)
					folderFiles = ((Solution)dataObject).RootFolder.Files;
				else if (dataObject is SolutionFolder)
					folderFiles = ((SolutionFolder)dataObject).Files;

				builder.AddChildren (Directory.EnumerateFiles (path)
									 .Where (file => (project == null || project.Files.GetFile (file) == null) && (folderFiles == null || !folderFiles.Contains (file)))
									 .Select (file => new SystemFile (file, project)));

				builder.AddChildren (Directory.EnumerateDirectories (path)
									 .Where (folder => !builder.HasChild (Path.GetFileName (folder), typeof (ProjectFolder)))
									 .Select (folder => new ProjectFolder (folder, project)));
			}
		}
		public static void FillNamespaces (ITreeBuilder builder, Project project, string ns)
		{
			ProjectDom dom = ProjectDomService.GetProjectDom (project);
			List<IMember> members = dom.GetNamespaceContents (ns, false, false);
			//IParserContext ctx = IdeApp.Workspace.ParserDatabase.GetProjectParserContext (project);
			if (members.Count > 0) {
				if (builder.Options ["ShowProjects"])
					builder.AddChild (new ProjectNamespaceData (project, ns));
				else {
					if (!builder.HasChild (ns, typeof (NamespaceData)))
						builder.AddChild (new ProjectNamespaceData (null, ns));
				}
			}
			foreach (IMember ob in members) {
				if (ob is Namespace) {
					FillNamespaces (builder, project, ns + "." + ((Namespace)ob).Name);
				}
			}
		}
        void AddProjectContent(ITreeBuilder builder, Project project, NamespaceData nsData, ArrayList list)
        {
            bool nestedNs = builder.Options ["NestedNamespaces"];
            bool publicOnly = builder.Options ["PublicApiOnly"];

            foreach (object ob in list) {
                if (ob is string && nestedNs) {
                    string ns = nsData.FullName + "." + ob;
                    if (!builder.HasChild (ob as string, typeof(NamespaceData)))
                        builder.AddChild (new NamespaceData (project, ns));
                }
                else if (ob is IClass) {
                    if (!publicOnly || ((IClass)ob).IsPublic)
                        builder.AddChild (new ClassData (project, ob as IClass));
                }
            }
        }
		public override void BuildChildNodes (ITreeBuilder builder, object dataObject)
		{
			string path = GetFolderPath (dataObject);
			if (builder.Options ["ShowAllFiles"] && Directory.Exists (path))
			{
				Project project = (Project) builder.GetParentDataItem (typeof(Project), true);
				SolutionFolderFileCollection folderFiles = null;
				if (dataObject is Solution)
					folderFiles = ((Solution)dataObject).RootFolder.Files;
				else if (dataObject is SolutionFolder)
					folderFiles = ((SolutionFolder)dataObject).Files;
				
				foreach (string file in Directory.GetFiles (path)) {
					if ((project == null || project.Files.GetFile (file) == null) && (folderFiles == null || !folderFiles.Contains (file)))
						builder.AddChild (new SystemFile (file, project));
				}
				
				foreach (string folder in Directory.GetDirectories (path))
					if (!builder.HasChild (Path.GetFileName (folder), typeof(ProjectFolder)))
						builder.AddChild (new ProjectFolder (folder, project));
			}
		}
		void AddProjectContent (ITreeBuilder builder, List<IMember> list)
		{
			bool nestedNs = builder.Options ["NestedNamespaces"];
			bool publicOnly = builder.Options ["PublicApiOnly"];

			foreach (IMember ob in list) {
				if (ob is Namespace && nestedNs) {
					Namespace nsob = (Namespace)ob;
					string ns = FullName + "." + nsob.Name;
					if (!builder.HasChild (nsob.Name, typeof(NamespaceData)))
						builder.AddChild (new ProjectNamespaceData (project, ns));
				}
				else if (ob is IType) {
					if (!publicOnly || ((IType)ob).IsPublic)
						builder.AddChild (new ClassData (project, ob as IType));
				}
			}
		}
		void AddProjectContent (ITreeBuilder builder, Project p)
		{
			builder.AddChildren (namesp.GetNamespaceMembers ()
								 .Where (ns => !builder.HasChild (ns.Name, typeof (NamespaceData)))
								 .Select (ns => new ProjectNamespaceData (project, ns)));
			//			bool nestedNs = builder.Options ["NestedNamespaces"];
			bool publicOnly = builder.Options ["PublicApiOnly"];

			builder.AddChildren (namesp.GetAllTypes ()
								 .Where (type => !publicOnly || type.DeclaredAccessibility == Accessibility.Public)
								 .Select (type => new ClassData (project, type)));
		}