예제 #1
0
        private void loadBtn_Click(object sender, EventArgs e)
        {
            var loadFolderPath = new FolderSelectDialog();
            var doc            = new XmlDocument();

            if (loadFolderPath.ShowDialog())
            {
                var externalProjectsBindingList = new BindingList <ProjectDetails>();
                _areExternalStudioProjects = true;
                _languages.Clear();
                _projectsDataSource.Clear();
                var projectsPathList = Directory.GetFiles(loadFolderPath.FileName, "*.sdlproj", SearchOption.AllDirectories);
                foreach (var projectPath in projectsPathList)
                {
                    var reportFolderPath = Path.Combine(projectPath.Substring(0, projectPath.LastIndexOf(@"\", StringComparison.Ordinal)), "Reports");
                    if (Help.ReportFileExist(reportFolderPath))
                    {
                        var projectDetails = ProjectInformation.GetExternalProjectDetails(projectPath);

                        doc.Load(projectDetails.ProjectPath);
                        Help.LoadReports(doc, projectDetails.ProjectFolderPath, projectDetails);
                        externalProjectsBindingList.Add(projectDetails);
                    }
                }
                foreach (var item in externalProjectsBindingList)
                {
                    _projectsDataSource.Add(item);
                }

                projListbox.DataSource = _projectsDataSource;
                RefreshProjectsListBox();
                RefreshLanguageListbox();
            }
        }