public override void StageStart()
        {
            _initializing = true;
            radioSelectExisting.Enabled = _data.Profiles.Any();
            PopulateProfiles();
            if (_data.ActiveProfile != null)
            {
                var index = _data.Profiles.FindIndex(x => x.Id == _data.ActiveProfile.Id);
                if (index >= 0)
                {
                    comboProfiles.SelectedIndex = index;
                    radioSelectExisting.Checked = true;
                    radioCreateNew.Checked      = false;
                }
                else
                {
                    radioSelectExisting.Checked = comboProfiles.Enabled = false;
                    radioCreateNew.Checked      = true;
                }
            }
            else
            {
                radioCreateNew.Checked      = true;
                radioSelectExisting.Checked = lblSelect.Visible = comboProfiles.Visible = false;
                _data.ActiveProfile         = _data.CreateDefaultProfile();
            }

            _initializing = false;

            _WizardStageChanged();
        }
예제 #2
0
        private void PopulateProfiles()
        {
            int profileCount = _data.Profiles.Count;

            if (profileCount == 0)
            {
                ExportProfile profile = _data.CreateDefaultProfile();
                _data.Profiles.Add(profile);
            }

            _profiles = new BindingList <ExportProfile>(_data.Profiles);

            comboProfiles.DataSource = new BindingSource {
                DataSource = _profiles
            };
            comboProfiles.SelectedIndex = 0;

            _WizardStageChanged();
        }