private void editChannelToolStripMenuItem_Click(object sender, EventArgs e) { ListView.SelectedIndexCollection indexes = listView1.SelectedIndices; if (indexes.Count == 0) return; for (int i = indexes.Count - 1; i >= 0; i--) { int index = indexes[i]; if (index >= 0 && index < listView1.Items.Count) { ListViewItem item = listView1.Items[index]; RadioGroupMap map = (RadioGroupMap)item.Tag; Channel channel = map.ReferencedChannel(); FormEditChannel dlg = new FormEditChannel(); dlg.Channel = channel; dlg.IsTv = false; dlg.ShowDialog(); listView1.Items[indexes[0]].Text = channel.DisplayName; listView1.Items[indexes[0]].SubItems[1].Text = channel.ChannelNumber.ToString(); return; } } ReOrder(); }
private void editChannelToolStripMenuItem_Click(object sender, EventArgs e) { ListView.SelectedIndexCollection indexes = listView1.SelectedIndices; if (indexes.Count == 0) return; for (int i = indexes.Count - 1; i >= 0; i--) { int index = indexes[i]; if (index >= 0 && index < listView1.Items.Count) { ListViewItem item = listView1.Items[index]; GroupMap map = (GroupMap)item.Tag; Channel channel = map.ReferencedChannel(); FormEditChannel dlg = new FormEditChannel(); dlg.Channel = channel; dlg.ShowDialog(); return; } } ReOrder(); }
private void mpButtonEdit_Click(object sender, EventArgs e) { ListView.SelectedIndexCollection indexes = mpListView1.SelectedIndices; if (indexes.Count == 0) return; Channel channel = (Channel)mpListView1.Items[indexes[0]].Tag; FormEditChannel dlg = new FormEditChannel(); dlg.Channel = channel; if (dlg.ShowDialog(this) == DialogResult.OK) { IList<Card> dbsCards = Card.ListAll(); Dictionary<int, CardType> cards = new Dictionary<int, CardType>(); foreach (Card card in dbsCards) { cards[card.IdCard] = RemoteControl.Instance.Type(card.IdCard); } mpListView1.BeginUpdate(); try { mpListView1.Items[indexes[0]] = _lvChannelHandler.CreateListViewItemForChannel(channel, cards); mpListView1.Sort(); ReOrder(); } finally { mpListView1.EndUpdate(); } } }
private void mpButtonAdd_Click(object sender, EventArgs e) { FormEditChannel dlg = new FormEditChannel(); dlg.Channel = null; if (dlg.ShowDialog(this) == DialogResult.OK) { IList<Card> dbsCards = Card.ListAll(); Dictionary<int, CardType> cards = new Dictionary<int, CardType>(); foreach (Card card in dbsCards) { cards[card.IdCard] = RemoteControl.Instance.Type(card.IdCard); } mpListView1.BeginUpdate(); try { mpListView1.Items.Add(_lvChannelHandler.CreateListViewItemForChannel(dlg.Channel, cards)); mpListView1.Sort(); ReOrder(); } finally { mpListView1.EndUpdate(); } } }
private void mpButtonEdit_Click(object sender, EventArgs e) { ListView.SelectedIndexCollection indexes = mpListView1.SelectedIndices; if (indexes.Count == 0) return; Channel channel = (Channel)mpListView1.Items[indexes[0]].Tag; FormEditChannel dlg = new FormEditChannel(); dlg.Channel = channel; if (dlg.ShowDialog(this) == DialogResult.OK) { mpListView1.BeginUpdate(); try { mpListView1.Items[indexes[0]].Text = channel.DisplayName; mpListView1.Items[indexes[0]].SubItems[1].Text = channel.ChannelNumber.ToString(); mpListView1.Items[indexes[0]].SubItems[5].Text = channel.ReferringTuningDetail().Count.ToString(); mpListView1.Sort(); ReOrder(); txtFilterString_TextChanged(null, null); } finally { mpListView1.EndUpdate(); } } }