/// <summary>
        /// Update the projects configuration.
        /// </summary>
        public void UpdateProjectList()
        {
            mainForm.ReloadConfiguration(() =>
            {
                var form = new DisplayChangedProjects(changeList);
                form.UpdateConfiguration += (servers) =>
                {
                    // Update each server
                    var projects = new List <CCTrayProject>(configuration.Projects);
                    foreach (var server in servers)
                    {
                        // Generate each project and add it to the configuration
                        foreach (var newProject in server.AddedProjects)
                        {
                            var projectConfig = new CCTrayProject
                            {
                                BuildServer = server.Configuration,
                                ProjectName = newProject,
                                ShowProject = true
                            };
                            projects.Add(projectConfig);
                        }

                        // Remove the old projects
                        foreach (var oldProject in server.DeletedProjects)
                        {
                            // Try to find the project
                            CCTrayProject actualProject = null;
                            foreach (var project in projects)
                            {
                                if (project.BuildServer.Equals(server.Configuration) &&
                                    project.ProjectName.Equals(oldProject))
                                {
                                    actualProject = project;
                                    break;
                                }
                            }

                            // If the project is found, it can be removed
                            if (actualProject != null)
                            {
                                projects.Remove(actualProject);
                            }
                        }
                    }
                    var newConfig      = configuration.Clone();
                    newConfig.Projects = projects.ToArray();

                    // Save the configuration and reload
                    newConfig.Persist();
                    mainForm.CloseUpdatePanel();
                };

                var result = form.ShowDialog(mainForm);
                return(result == DialogResult.OK);
            });
        }
        /// <summary>
        /// Update the projects configuration.
        /// </summary>
        public void UpdateProjectList()
        {
            mainForm.ReloadConfiguration(() =>
            {
                var form = new DisplayChangedProjects(changeList);
                form.UpdateConfiguration += (servers) =>
                {
                    // Update each server
                    var projects = new List<CCTrayProject>(configuration.Projects);
                    foreach (var server in servers)
                    {
                        // Generate each project and add it to the configuration
                        foreach (var newProject in server.AddedProjects)
                        {
                            var projectConfig = new CCTrayProject
                            {
                                BuildServer = server.Configuration,
                                ProjectName = newProject,
                                ShowProject = true

                            };
                            projects.Add(projectConfig);
                        }

                        // Remove the old projects
                        foreach (var oldProject in server.DeletedProjects)
                        {
                            // Try to find the project
                            CCTrayProject actualProject = null;
                            foreach (var project in projects)
                            {
                                if (project.BuildServer.Equals(server.Configuration) &&
                                    project.ProjectName.Equals(oldProject))
                                {
                                    actualProject = project;
                                    break;
                                }
                            }

                            // If the project is found, it can be removed
                            if (actualProject != null) projects.Remove(actualProject);
                        }
                    }
                    var newConfig = configuration.Clone();
                    newConfig.Projects = projects.ToArray();

                    // Save the configuration and reload
                    newConfig.Persist();
                    mainForm.CloseUpdatePanel();
                };

                var result = form.ShowDialog(mainForm);
                return (result == DialogResult.OK);
            });
        }