DesktopLiveStreamer.FrmAdd.btnModify_Click C# (CSharp) Method

btnModify_Click() private method

private btnModify_Click ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
        private void btnModify_Click(object sender, EventArgs e)
        {
            try
            {
                listStreams[modifyIndex].Caption = txtCaption.Text;
                listStreams[modifyIndex].StreamUrl = txtURL.Text;
                listStreams[modifyIndex].Quality = txtQuality.Text;
                listStreams.sort();

                try
                {
                    XMLPersist.saveStreamListConfig(listStreams);
                }
                catch (UnauthorizedAccessException)
                {
                    MessageBox.Show(this, "Error: Unable to save the configuration. Check if you have write " +
                                "permissions on the directory of the application.\n" +
                                "Desktop Live Streamer may require administrative rights on some systems.", "Write permission required", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }

                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.GetType() + " " + ex.Message, "Erreur!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }