Example #1
0
        public void AddItem(string fileName)
        {
            string             folderName = ResourceService.GetString("ICSharpCode.SharpDevelop.Commands.ProjectBrowser.SolutionItemsNodeText");
            SolutionFolderNode node       = null;

            foreach (TreeNode n in Nodes)
            {
                node = n as SolutionFolderNode;
                if (node != null && node.Folder.Name == folderName)
                {
                    break;
                }
                node = null;
            }
            if (node == null)
            {
                SolutionFolder newSolutionFolder = solution.CreateFolder(folderName);
                solution.AddFolder(newSolutionFolder);
                solution.Save();

                node = new SolutionFolderNode(solution, newSolutionFolder);
                node.AddTo(this);
            }
            node.AddItem(fileName);
        }
			internal bool AddContents(Solution solution, ProjectCreateInformation projectCreateInformation, string defaultLanguage, ISolutionFolderContainer parentFolder)
			{
				// Create sub projects
				foreach (SolutionFolderDescriptor folderDescriptor in solutionFoldersDescriptors) {
					SolutionFolder folder = solution.CreateFolder(folderDescriptor.name);
					parentFolder.AddFolder(folder);
					folderDescriptor.AddContents(solution, projectCreateInformation, defaultLanguage, folder);
				}
				foreach (ProjectDescriptor projectDescriptor in projectDescriptors) {
					IProject newProject = projectDescriptor.CreateProject(projectCreateInformation, defaultLanguage);
					if (newProject == null)
						return false;
					newProject.Location = FileUtility.GetRelativePath(projectCreateInformation.SolutionPath, newProject.FileName);
					parentFolder.AddFolder(newProject);
				}
				return true;
			}