BaconGame.GameMainForm.fileView_ItemSelectionChanged C# (CSharp) Метод

fileView_ItemSelectionChanged() приватный Метод

Occurs for each change of selection when a user selects a new file. Saves the deselected question file. Populates the question view with questions from the newly selected question file. Updates UI as appropriate.
private fileView_ItemSelectionChanged ( object sender, System.Windows.Forms.ListViewItemSelectionChangedEventArgs e ) : void
sender object
e System.Windows.Forms.ListViewItemSelectionChangedEventArgs
Результат void
        private void fileView_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
        {
            if (e.IsSelected)
            {
                _presenter.PopulateQuestionView(fileView.SelectedItems[0].Text);

                e.Item.ImageIndex = 1;
            }
            else
            {
                if (questionView.SelectedItems.Count > 0)
                    _presenter.SaveQuestion(questionView.SelectedIndices[0]);
                _presenter.SaveQuestionFile(e.Item.Text);
                _presenter.DepopulateQuestionView();
                _presenter.ClearTextFields();

                e.Item.ImageIndex = 0;
            }

            EnableTextFields();
        }