//=====================================================================

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="project">The current project</param>
        /// <param name="configuration">The current configuration element</param>
        public VersionBuilderConfigDlg(SandcastleProject project, XElement configuration)
        {
            InitializeComponent();

            this.project       = project ?? throw new ArgumentNullException(nameof(project));
            this.configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));

            if (!configuration.IsEmpty)
            {
                var currentProject = configuration.Element("currentProject");

                if (currentProject != null)
                {
                    txtLabel.Text           = currentProject.Attribute("label").Value;
                    txtVersion.Text         = currentProject.Attribute("version").Value;
                    chkRipOldAPIs.IsChecked = (bool)currentProject.Attribute("ripOldApis");
                }

                // Load the current settings
                foreach (var reference in configuration.Descendants("version"))
                {
                    lbVersionInfo.Items.Add(VersionSettings.FromXml(project, reference));
                }
            }

            btnDeleteProject.IsEnabled = grpVersionInfoProps.IsEnabled = lbVersionInfo.Items.Count != 0;

            if (lbVersionInfo.Items.Count != 0)
            {
                lbVersionInfo.SelectedIndex = 0;
            }
        }