Exemple #1
0
        private void AddProject(string projectLine)
        {
            string pattern = @"^Project\(""(?<unknown>\S+)""\) = ""(?<name>\S+)"", ""(?<path>\S+)"", ""(?<id>\S+)""";
            Regex  regex   = new Regex(pattern);
            Match  match   = regex.Match(projectLine);

            if (match.Success)
            {
                string unknown = match.Groups["unknown"].Value;
                string name    = match.Groups["name"].Value;
                string path    = match.Groups["path"].Value;
                string id      = match.Groups["id"].Value;

                path = ResolvePath(path);

                if (unknown == commonProjectId)
                {
                    Project project = new Project(this, new Guid(id), name);

                    string absoluteProjectPath = Path.Combine(SolutionDirectory, path);
                    project.Read(absoluteProjectPath);

                    string relativeProjectPath = Path.GetDirectoryName(path);
                    project.RelativePath = relativeProjectPath;

                    if (project.ProjectType == "C# Local" ||
                        project.ProjectType == "C# Web" ||
                        project.ProjectType == "VB Local" ||
                        project.ProjectType == "VB Web")
                    {
                        _Projects.Add(project.ID, project);
                    }
                }
                else if (unknown == enterproseProjectId)
                {
                    EnterpriseProject etpProject          = new EnterpriseProject(this, new Guid(id), name);
                    string            absoluteProjectPath = Path.Combine(SolutionDirectory, path);
                    etpProject.Read(absoluteProjectPath);

                    // get the list of projects from enterprise projects
                    foreach (Project project in etpProject.GetProjects())
                    {
                        _Projects.Add(project.ID, project);
                    }
                }
            }
        }
Exemple #2
0
        protected IList GetSubProjects()
        {
            ArrayList list = new ArrayList();

            foreach (string file in GetFiles())
            {
                string extension = Path.GetExtension(file);

                if (extension == ".etp")
                {
                    string            id         = GetReferenceID(file);
                    string            name       = Path.GetFileNameWithoutExtension(file);
                    EnterpriseProject subproject = new EnterpriseProject(this, _Solution, new Guid(id), name);

                    string absoluteProjectPath = Path.Combine(_RelativePath, file);
                    subproject.Read(absoluteProjectPath);

                    _SubProjects.Add(subproject);
                }
            }

            return(list);
        }
        protected IList GetSubProjects() {
            ArrayList list = new ArrayList();

            foreach (string file in GetFiles()) {
                string extension = Path.GetExtension(file);

                if (extension == ".etp") {
                    string id = GetReferenceID(file);
                    string name = Path.GetFileNameWithoutExtension(file);
                    EnterpriseProject subproject = new EnterpriseProject(this, _Solution, new Guid(id), name);

                    string absoluteProjectPath = Path.Combine(_RelativePath, file);
                    subproject.Read(absoluteProjectPath);

                    _SubProjects.Add(subproject);
                }
            }

            return list;
        }
Exemple #4
0
        private void AddProject(string projectLine) {
            string pattern = @"^Project\(""(?<unknown>\S+)""\) = ""(?<name>\S+)"", ""(?<path>\S+)"", ""(?<id>\S+)""";
            Regex regex = new Regex(pattern);
            Match match = regex.Match(projectLine);

            if (match.Success) {
                string unknown = match.Groups["unknown"].Value;
                string name = match.Groups["name"].Value;
                string path = match.Groups["path"].Value;
                string id = match.Groups["id"].Value;

                path = ResolvePath(path);

                if (unknown == commonProjectId) {
                    Project project = new Project(this, new Guid(id), name);

                    string absoluteProjectPath = Path.Combine(SolutionDirectory, path);
                    project.Read(absoluteProjectPath);

                    string relativeProjectPath = Path.GetDirectoryName(path);
                    project.RelativePath = relativeProjectPath;

                    if (project.ProjectType == "C# Local" ||
                        project.ProjectType == "C# Web" ||
                        project.ProjectType == "VB Local" ||
                        project.ProjectType == "VB Web") {
                        _Projects.Add(project.ID, project);
                    }
                } 
                else if (unknown == enterproseProjectId) {
                    EnterpriseProject etpProject = new EnterpriseProject(this, new Guid(id), name);
                    string absoluteProjectPath = Path.Combine(SolutionDirectory, path);
                    etpProject.Read(absoluteProjectPath);

                    // get the list of projects from enterprise projects
                    foreach(Project project in etpProject.GetProjects()) {
                        _Projects.Add(project.ID, project);
                    }
                }
            }
        }