Smrf.NodeXL.ExcelTemplate.TopNByMetricUserSettingsListDialog.btnAdd_Click C# (CSharp) Method

btnAdd_Click() private method

private btnAdd_Click ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
    btnAdd_Click
    (
        object sender,
        EventArgs e
    )
    {
        AssertValid();

        // Let the user edit a new TopNByMetricUserSettings object.

        TopNByMetricUserSettings oTopNByMetricUserSettings =
            new TopNByMetricUserSettings();

        if ( TryEditTopNByMetricUserSettings(oTopNByMetricUserSettings) )
        {
            // Add the new object to the List and the ListBox, then select the
            // object in the ListBox.

            m_oTopNByMetricUserSettingsClone.Add(oTopNByMetricUserSettings);
            DoDataExchange(false);

            lbxTopNByMetricUserSettings.SelectedIndex =
                lbxTopNByMetricUserSettings.Items.Count - 1;
        }
    }