src/Misc/EFTools/EntityDesign/VisualStudio/ModelWizard/gui/WizardPageStart.cs
// <summary>
//     SelectedIndexChanged event: fired by ListBox when the selection changes
// </summary>
SelectedIndexChanged event: fired by ListBox when the selection changes
SelectedIndexChanged event : fired by ListBox when the selection changes
private void listViewModelContents_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (AnyItemSelected)
            {
                RemoveAllExceptFirstPage();
                var nSelectedItemIndex = GetSelectedOptionIndex();
                if (nSelectedItemIndex == GenerateEmptyModelIndex)
                {
                    textboxListViewSelectionInfo.Text = Resources.StartPage_EmptyModelText;
                    Wizard.ModelBuilderSettings.GenerationOption = ModelGenerationOption.EmptyModel;
                    Wizard.OnValidationStateChanged(this);
                }
                else if (nSelectedItemIndex == GenerateFromDatabaseIndex)
                {
                    textboxListViewSelectionInfo.Text = Resources.StartPage_GenerateFromDBText;
                    Wizard.ModelBuilderSettings.GenerationOption = ModelGenerationOption.GenerateFromDatabase;
                    AddPagesForReverseEngineerDb();
                    Wizard.OnValidationStateChanged(this);
                }
                else if (nSelectedItemIndex == GenerateEmptyModelCodeFirstIndex)
                {
                    Debug.Assert(
                        NetFrameworkVersioningHelper.TargetNetFrameworkVersion(Wizard.ModelBuilderSettings.Project, Wizard.ServiceProvider)
                        > NetFrameworkVersioningHelper.NetFrameworkVersion3_5, "Option should be disabled for .NET Framework 3.5");
                    Wizard.ModelBuilderSettings.GenerationOption = ModelGenerationOption.EmptyModelCodeFirst;
                    textboxListViewSelectionInfo.Text =
                        _codeFirstAllowed
                            ? Resources.StartPage_EmptyModelCodeFirstText
                            : string.Format(
                                CultureInfo.InvariantCulture, "{0}\r\n{1}",
                                Resources.StartPage_CodeFirstSupportedOnlyForEF6, Resources.StartPage_EmptyModelCodeFirstText);
                    Wizard.OnValidationStateChanged(this);
                    Wizard.EnableButton(ButtonType.Finish, _codeFirstAllowed);
                }
                else
                {
                    Debug.Assert(nSelectedItemIndex == GenerateCodeFirstFromDatabaseIndex, "Unexpected Index");
                    Wizard.ModelBuilderSettings.GenerationOption = ModelGenerationOption.CodeFirstFromDatabase;
                    textboxListViewSelectionInfo.Text = 
                        _codeFirstAllowed ? 
                            Resources.StartPage_CodeFirstFromDatabaseText :
                            string.Format(
                                CultureInfo.InvariantCulture, "{0}\r\n{1}",
                                Resources.StartPage_CodeFirstSupportedOnlyForEF6, Resources.StartPage_CodeFirstFromDatabaseText);
                    AddPagesForReverseEngineerDb();
                    Wizard.OnValidationStateChanged(this);
                    Wizard.EnableButton(ButtonType.Next, _codeFirstAllowed);
                }
            }
        }
private void listViewModelContents_SelectedIndexChanged ( object sender , EventArgs e ) { if ( AnyItemSelected ) { RemoveAllExceptFirstPage ( ) ; var nSelectedItemIndex = GetSelectedOptionIndex ( ) ; if ( nSelectedItemIndex == GenerateEmptyModelIndex ) { textboxListViewSelectionInfo . Text = Resources . StartPage_EmptyModelText ; Wizard . ModelBuilderSettings . GenerationOption = ModelGenerationOption . EmptyModel ; Wizard . OnValidationStateChanged ( this ) ; } else if ( nSelectedItemIndex == GenerateFromDatabaseIndex ) { textboxListViewSelectionInfo . Text = Resources . StartPage_GenerateFromDBText ; Wizard . ModelBuilderSettings . GenerationOption = ModelGenerationOption . GenerateFromDatabase ; AddPagesForReverseEngineerDb ( ) ; Wizard . OnValidationStateChanged ( this ) ; } else if ( nSelectedItemIndex == GenerateEmptyModelCodeFirstIndex ) { Debug . Assert ( NetFrameworkVersioningHelper . TargetNetFrameworkVersion ( Wizard . ModelBuilderSettings . Project , Wizard . ServiceProvider ) > NetFrameworkVersioningHelper . NetFrameworkVersion3_5 , " " ) ; Wizard . ModelBuilderSettings . GenerationOption = ModelGenerationOption . EmptyModelCodeFirst ; textboxListViewSelectionInfo . Text = _codeFirstAllowed ? Resources . StartPage_EmptyModelCodeFirstText : string . Format ( CultureInfo . InvariantCulture , " \r \n " , Resources . StartPage_CodeFirstSupportedOnlyForEF6 , Resources . StartPage_EmptyModelCodeFirstText ) ; Wizard . OnValidationStateChanged ( this ) ; Wizard . EnableButton ( ButtonType . Finish , _codeFirstAllowed ) ; } else { Debug . Assert ( nSelectedItemIndex == GenerateCodeFirstFromDatabaseIndex , " " ) ; Wizard . ModelBuilderSettings . GenerationOption = ModelGenerationOption . CodeFirstFromDatabase ; textboxListViewSelectionInfo . Text = _codeFirstAllowed ? Resources . StartPage_CodeFirstFromDatabaseText : string . Format ( CultureInfo . InvariantCulture , " \r \n " , Resources . StartPage_CodeFirstSupportedOnlyForEF6 , Resources . StartPage_CodeFirstFromDatabaseText ) ; AddPagesForReverseEngineerDb ( ) ; Wizard . OnValidationStateChanged ( this ) ; Wizard . EnableButton ( ButtonType . Next , _codeFirstAllowed ) ; } } }
SelectedIndexChanged event: fired by ListBox when the selection changes
SelectedIndexChanged event : fired by ListBox when the selection changes
sender
object
e
EventArgs