//public static void SaveFile(string filename, ProjectConfigList projectConfigList) //{ // if (CurrentFileType == FileTypes.Sln) // { // //projectConfigList.ForEach(x => // // { // // }); // } // else if (CurrentFileType == FileTypes.CsProj) // { // } //} public static ProjectConfigList LoadFile(string filename) { ProjectConfigList.Current.Clear(); CurrentFilename = filename; CurrentProjectFiles = new CsProjFileList(); CurrentProjectFiles.Clear(); switch (CurrentFileType) { case FileTypes.CsProj: CurrentProjectFiles = CsProjFileList.GetFromCsProjFile(filename); return CurrentProjectFiles.BindableList; //Solution sln3 = new Solution(@"C:\lifemed\main\lifemed\lifemed.sln"); //object obj3 = sln3.Projects; //Project project = new Project(filename); //object obj2 = project; //Console.WriteLine(obj2); break; case FileTypes.Sln: CurrentProjectFiles = CsProjFileList.GetFromSolutionFile(filename); return CurrentProjectFiles.BindableList; //Solution sln = new Solution(filename); //object obj = sln.Projects; //Console.WriteLine(obj); break; case FileTypes.Unknown: throw new FileLoadException("Filename is incorrect"); } return null; }
public static CsProjFileList GetFromCsProjFile(string csprojFilename) { CsProjFile csproj = CsProjFile.InitCsProjFile(csprojFilename); CurrentProjects = new CsProjFileList(); CurrentProjects.Clear(); CurrentProjects.Add(csproj); return CurrentProjects; }
public static CsProjFileList GetFromSolutionFile(string solutionFilename) { CurrentProjects = new CsProjFileList(); CurrentProjects.Clear(); ForEachProjectInSolution( solutionFilename, projectFilename => CurrentProjects.Add(CsProjFile.InitCsProjFile(projectFilename))); return CurrentProjects; }