コード例 #1
0
        //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;
        }
コード例 #2
0
        public static CsProjFileList GetFromCsProjFile(string csprojFilename)
        {
            CsProjFile csproj = CsProjFile.InitCsProjFile(csprojFilename);

            CurrentProjects = new CsProjFileList();
            CurrentProjects.Clear();

            CurrentProjects.Add(csproj);

            return CurrentProjects;
        }
コード例 #3
0
        public static CsProjFileList GetFromSolutionFile(string solutionFilename)
        {
            CurrentProjects = new CsProjFileList();
            CurrentProjects.Clear();

            ForEachProjectInSolution(
                solutionFilename,
                projectFilename =>
                    CurrentProjects.Add(CsProjFile.InitCsProjFile(projectFilename)));

            return CurrentProjects;
        }