private void _programsDataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 3 && e.RowIndex >= 0 && e.RowIndex < _programsDataGridView.Rows.Count) { UpcomingOrActiveProgramView programView = _programsDataGridView.Rows[e.RowIndex].DataBoundItem as UpcomingOrActiveProgramView; if (programView.UpcomingProgram.GuideProgramId.HasValue) { using (GuideServiceAgent tvGuideAgent = new GuideServiceAgent()) { GuideProgram guideProgram = tvGuideAgent.GetProgramById(programView.UpcomingProgram.GuideProgramId.Value); using (ProgramDetailsPopup popup = new ProgramDetailsPopup()) { popup.Channel = programView.UpcomingProgram.Channel; popup.GuideProgram = guideProgram; Point location = Cursor.Position; location.Offset(-250, -40); popup.Location = location; popup.ShowDialog(this); } } } } }
private void _programsDataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 3 && e.RowIndex >= 0 && e.RowIndex < _programsDataGridView.Rows.Count) { ChannelProgramView programView = _programsDataGridView.Rows[e.RowIndex].DataBoundItem as ChannelProgramView; GuideProgram guideProgram = Proxies.GuideService.GetProgramById(programView.Program.GuideProgramId).Result; using (ProgramDetailsPopup popup = new ProgramDetailsPopup()) { popup.Channel = programView.Program.Channel; popup.GuideProgram = guideProgram; Point location = Cursor.Position; location.Offset(-250, -40); popup.Location = location; popup.ShowDialog(this); } } }
private void _epgControl_ProgramClicked(object sender, ArgusTV.WinForms.Controls.EpgControl.ProgramEventArgs e) { try { GuideProgram guideProgram = Proxies.GuideService.GetProgramById(e.GuideProgram.GuideProgramId).Result; using (ProgramDetailsPopup popup = new ProgramDetailsPopup()) { popup.Channel = e.Channel; popup.GuideProgram = guideProgram; Point location = _epgControl.PointToScreen(e.Location); location.Offset(-250, -40); popup.Location = location; popup.ShowDialog(this); } } catch (Exception ex) { MessageBox.Show(this, ex.Message, null, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void _channelsGridView_CellContentClick(object sender, DataGridViewCellEventArgs e) { if ((e.ColumnIndex == ColumnIndex.CurrentTitle || e.ColumnIndex == ColumnIndex.NextTitle) && e.RowIndex >= 0 && e.RowIndex < _channelsGridView.Rows.Count) { CurrentAndNextProgramView programView = _channelsGridView.Rows[e.RowIndex].DataBoundItem as CurrentAndNextProgramView; GuideProgramSummary programSummary = (e.ColumnIndex == ColumnIndex.CurrentTitle) ? programView.CurrentAndNextProgram.Current : programView.CurrentAndNextProgram.Next; if (programSummary != null) { GuideProgram guideProgram = Proxies.GuideService.GetProgramById(programSummary.GuideProgramId).Result; using (ProgramDetailsPopup popup = new ProgramDetailsPopup()) { popup.Channel = programView.CurrentAndNextProgram.Channel; popup.GuideProgram = guideProgram; Point location = Cursor.Position; location.Offset(-250, -40); popup.Location = location; popup.ShowDialog(this); } } } }