示例#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)
            {
                ISolutionFolder newSolutionFolder = solution.CreateFolder(folderName);
                solution.Save();

                node = new SolutionFolderNode(newSolutionFolder);
                node.InsertSorted(this);
            }
            node.AddItem(fileName);
        }