Пример #1
0
        private void InitializeProjectsObjects()
        {
            RaiseDocumentationGenerationStepDoneEvent(1, "Creating projects' objects...");

            foreach (Project proj in m_SolutionProjects)
            {
                if (File.Exists(proj.ProjectAbsolutePath))
                {
                    ProjectReader currProjReader;
                    switch (proj.UsedLangage)
                    {
                    case Project.LangageType.CPP:
                        currProjReader = new CPPProjectReader(proj);
                        ((CPPProjectReader)currProjReader).ProjectReadEvent += currProjReader_ProjectReadEvent;
                        break;

                    case Project.LangageType.CS:
                        currProjReader = new CSProjectReader(proj);
                        ((CSProjectReader)currProjReader).ProjectReadEvent += currProjReader_ProjectReadEvent;
                        break;

                    case Project.LangageType.VB:
                        currProjReader = new VBProjectReader(proj);
                        ((VBProjectReader)currProjReader).ProjectReadEvent += currProjReader_ProjectReadEvent;
                        break;

                    default:
                        currProjReader = new ProjectReader(proj);
                        break;
                    }

                    if (currProjReader != null)
                    {
                        if (!currProjReader.ReadProject())
                        {
                        }

                        if (currProjReader.GetType() == typeof(CPPProjectReader))
                        {
                            ((CPPProjectReader)currProjReader).ProjectReadEvent += currProjReader_ProjectReadEvent;
                        }
                        else if (currProjReader.GetType() == typeof(CSProjectReader))
                        {
                            ((CSProjectReader)currProjReader).ProjectReadEvent += currProjReader_ProjectReadEvent;
                        }
                        else if (currProjReader.GetType() == typeof(VBProjectReader))
                        {
                            ((VBProjectReader)currProjReader).ProjectReadEvent += currProjReader_ProjectReadEvent;
                        }
                    }
                }
            }

            RaiseDocumentationGenerationStepDoneEvent(1, "Done creating projects' objects.");
        }