示例#1
0
        AddNestedEntity(
            string parentpath,
            string currentpath,
            VSProject project,
            VSSolutionFolder parent = null)
        {
            var split   = currentpath.Split('/');
            var path    = split[0];
            var keyPath = string.Join("/", parentpath, path);

            lock (this.SolutionFolders)
            {
                if (!this.SolutionFolders.ContainsKey(keyPath))
                {
                    this.SolutionFolders.Add(keyPath, new VSSolutionFolder(keyPath, path));
                }
            }
            var folder = this.SolutionFolders[keyPath];

            if (null != parent)
            {
                parent.appendNestedEntity(folder);
            }
            if (1 == split.Length)
            {
                folder.appendNestedEntity(project);
            }
            else
            {
                this.AddNestedEntity(keyPath, string.Join("/", split.Skip(1)), project, folder);
            }
        }
示例#2
0
        AddNestedEntity(
            string fullpath,
            VSProject project,
            VSSolutionFolder parent = null)
        {
            var split = fullpath.Split('/');
            var path  = split[0];

            if (!this.SolutionFolders.ContainsKey(path))
            {
                this.SolutionFolders.Add(path, new VSSolutionFolder(path));
            }
            var folder = this.SolutionFolders[path];

            if (null != parent)
            {
                parent.NestedEntities.AddUnique(folder);
            }
            if (1 == split.Length)
            {
                folder.NestedEntities.AddUnique(project);
            }
            else
            {
                this.AddNestedEntity(string.Join("/", split.Skip(1)), project, folder);
            }
        }
示例#3
0
 private void AddNestedEntity(
     string fullpath,
     VSProject project,
     VSSolutionFolder parent = null)
 {
     var split = fullpath.Split('/');
     var path = split[0];
     if (!this.SolutionFolders.ContainsKey(path))
     {
         this.SolutionFolders.Add(path, new VSSolutionFolder(path));
     }
     var folder = this.SolutionFolders[path];
     if (null != parent)
     {
         parent.NestedEntities.AddUnique(folder);
     }
     if (1 == split.Length)
     {
         folder.NestedEntities.AddUnique(project);
     }
     else
     {
         this.AddNestedEntity(string.Join("/", split.Skip(1)), project, folder);
     }
 }