예제 #1
0
        public SolutionItem(Connect connect, Solution solution, bool recursive)
        {
            this._subItems    = new List <SolutionItem>();
            this._projectType = LanguageType.None;

            if (connect == null)
            {
                throw new ArgumentNullException("connect");
            }

            if (solution == null)
            {
                throw new ArgumentNullException("solution");
            }

            this._incrementSetting = new SolutionItemIncrementSettings(this);
            this._connect          = connect;
            this._item             = solution;
            this._itemType         = SolutionItemType.Solution;
            this._name             = Path.GetFileNameWithoutExtension(solution.FileName);
            this._filename         = solution.FileName;
            this._uniqueName       = this._name;
            this.GetGlobalVariables();
            if (recursive)
            {
                SolutionItem.FillSolutionTree(connect, this, solution.Projects);
            }
        }
예제 #2
0
        private SolutionItem(Connect connect, Project project, bool recursive)
        {
            this._subItems    = new List <SolutionItem>();
            this._projectType = LanguageType.None;

            if (project == null)
            {
                throw new ArgumentNullException("project");
            }

            if (connect == null)
            {
                throw new ArgumentNullException("connect");
            }

            this._incrementSetting = new SolutionItemIncrementSettings(this);
            this._connect          = connect;
            this._item             = project;
            this._name             = project.Name;
            this._filename         = project.FileName;
            this._uniqueName       = project.UniqueName;
            if (!string.IsNullOrEmpty(this._filename) && string.IsNullOrEmpty(Path.GetExtension(this._filename)))
            {
                this._filename += Path.GetExtension(project.UniqueName);
            }
            if (string.IsNullOrEmpty(project.FullName))
            {
                this._itemType = SolutionItemType.Folder;
                if (recursive)
                {
                    SolutionItem.FillSolutionTree(connect, this, project.ProjectItems);
                }
            }
            else
            {
                this._itemType = SolutionItemType.Project;
                this.GetGlobalVariables();
            }
        }