private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (listBox1.SelectedIndex == -1)
            {
                txtNo.Text   = "";
                txtName.Text = "";
                return;
            }

            var channel = listBox1.SelectedItem as ChannelMapChannel;

            txtNo.Text         = channel.Setup.ChannelNumber.ToString();
            txtFavoriteNo.Text = channel.Setup.FavoriteNumber.ToString();
            var cName = OnkaHelper.GetChannelName(channel.Setup.ChannelName);

            txtName.Text          = cName.Name;
            lblChannelSuffix.Text = cName.Suffix;
        }
        private void btnChange_Click(object sender, EventArgs e)
        {
            if (listBox1.SelectedIndex == -1)
            {
                return;
            }
            var channel = listBox1.SelectedItem as ChannelMapChannel;

            var newNo = Convert.ToUInt16(txtNo.Text);

            if (channel.Setup.ChannelNumber != newNo)
            {
                var otherChannel = root.Channel.FirstOrDefault(x => x.Setup.ChannelNumber == newNo);
                if (otherChannel != null)
                {
                    Log(otherChannel.Setup._niceChannelName + " " + otherChannel.Setup.ChannelNumber + " => " + channel.Setup.ChannelNumber);

                    otherChannel.Setup.ChannelNumber = channel.Setup.ChannelNumber;
                }
            }
            Log(channel.Setup._niceChannelName + " " + channel.Setup.ChannelNumber + " => " + newNo + ", " + txtName.Text);

            channel.Setup.ChannelNumber  = newNo;
            channel.Setup.FavoriteNumber = Convert.ToInt32(txtFavoriteNo.Text);
            var cName = OnkaHelper.GetChannelName(channel.Setup.ChannelName);

            cName.Name = txtName.Text;
            channel.Setup.ChannelName = OnkaHelper.SetChannelName(cName);

            ReBindList(listBox1.SelectedIndex, channel);

            if (cAutoSort.Checked)
            {
                SortByNo();
            }
        }