private void listView1_DoubleClick(object sender, EventArgs e) { Channels channels = Channels.Get(); if (chList.SelectedItems.Count > 0) { ListViewItem item = chList.SelectedItems[0]; ChannelInfo channel = channels.GetChannel(int.Parse(item.SubItems[0].Text)); ChangeChannelTo(channel, item.SubItems[0].Text); } }
private void listView1_DoubleClick(object sender, EventArgs e) { Channels channels = Channels.Get(); if (chList.SelectedItems.Count > 0) { ListViewItem item = chList.SelectedItems[0]; ChannelInfo channel = channels.GetChannel(int.Parse(item.SubItems[0].Text)); if (channel == null) { MessageBox.Show(item.SubItems[1].Text); } else { player.Stop(); isChannel = channel.ChannelType == ChType.CHANNEL; isPaused = false; Thread.Sleep(500); player.Load(channel.URL); try { string chName = channel.TVGName.Length < 100 ? channel.TVGName : channel.TVGName.Substring(0, 99); Task <string> stats = Utils.GetAsync("" + chName); } catch (Exception ex) { Console.WriteLine("HATA GÖNDERME İSTATİSTİKLERİ"); } logoChannel.LoadCompleted -= logoLoaded; logoChannel.Image = Image.FromFile("./resources/images/nochannel.png"); if (!string.IsNullOrEmpty(channel.TVGLogo)) { logoChannel.LoadAsync(channel.TVGLogo); logoChannel.LoadCompleted += logoLoaded; } string title = channel.Title; if (title.Length > 20) { title = title.Substring(0, 20) + "..."; } lbChName.Text = title; currentChannel = channel; currentChType = channel.ChannelType; SetEPG(channel); } } }