Example #1
0
        // 从文件内容中获取solution中包含的project
        private void getIncludedProject(string fileContent)
        {
            Regex regex = new Regex(@"(?<=Project)(\(""\{[a-z0-9A-Z]{8}-[a-z0-9-A-Z]{4}-[a-z0-9A-Z]{4}-[a-z0-9A-Z]{4}-[a-z0-9A-Z]{12}\}""\))\s*=\s*""(?'projectName'[A-Za-z0-9]*)""\s*,\s*""(?'projectPath'([A-Za-z0-9]*\\)*[A-Za-z0-9]*.csproj)""\s*,\s*""\{([a-z0-9A-Z]{8}-[a-z0-9-A-Z]{4}-[a-z0-9A-Z]{4}-[a-z0-9A-Z]{4}-[a-z0-9A-Z]{12})\}""");
            MatchCollection projectPathInfoMatches = regex.Matches(fileContent);

            string name;
            string path;

            PathProjectPair projectPathDict;

            foreach (Match match in projectPathInfoMatches)
            {
                projectPathDict = new PathProjectPair();
                projectPathDict.Name = match.Groups["projectName"].Value;
                projectPathDict.Path = Path.Combine(_solutionFileDir, match.Groups["projectPath"].Value);
                _projectPathList.Add(projectPathDict);

            }
        }
 public bool Contains(PathProjectPair item)
 {
     throw new NotImplementedException();
 }
 public void Add(PathProjectPair item)
 {
     throw new NotImplementedException();
 }
 public bool Remove(PathProjectPair item)
 {
     throw new NotImplementedException();
 }
 public void CopyTo(PathProjectPair[] array, int arrayIndex)
 {
     throw new NotImplementedException();
 }