public ProgramEventArgs(GuideProgramSummary guideProgram, Channel channel, Point location) { this.GuideProgram = guideProgram; this.Channel = channel; this.Location = location; this.UpcomingProgramId = guideProgram.GetUniqueUpcomingProgramId(channel.ChannelId); }
private void _channelsGridView_MouseUp(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { DataGridView.HitTestInfo htinfo = _channelsGridView.HitTest(e.X, e.Y); if (htinfo.Type == DataGridViewHitTestType.Cell) { CurrentAndNextProgramView programView = _channelsGridView.Rows[htinfo.RowIndex].DataBoundItem as CurrentAndNextProgramView; if (programView != null) { GuideProgramSummary guideProgram = null; if (htinfo.ColumnIndex == ColumnIndex.CurrentIcon || htinfo.ColumnIndex == ColumnIndex.CurrentTitle) { guideProgram = programView.CurrentAndNextProgram.Current; } else if (htinfo.ColumnIndex == ColumnIndex.NextIcon || htinfo.ColumnIndex == ColumnIndex.NextTitle) { guideProgram = programView.CurrentAndNextProgram.Next; } if (guideProgram != null) { Guid upcomingProgramId = guideProgram.GetUniqueUpcomingProgramId(programView.CurrentAndNextProgram.Channel.ChannelId); GuideUpcomingProgram upcomingProgramInfo = null; _allUpcomingGuidePrograms.TryGetValue(upcomingProgramId, out upcomingProgramInfo); _channelsGridView.Rows[htinfo.RowIndex].Selected = true; ScheduleType? scheduleType = null; UpcomingProgram upcomingProgram = null; UpcomingGuideProgram upcomingGuideProgram = null; if (upcomingProgramInfo != null) { scheduleType = upcomingProgramInfo.Type; upcomingProgram = upcomingProgramInfo.UpcomingRecording != null ? upcomingProgramInfo.UpcomingRecording.Program : null; upcomingGuideProgram = upcomingProgramInfo.UpcomingGuideProgram; } _programContextMenuStrip.SetTarget(programView.CurrentAndNextProgram.Channel, guideProgram.GuideProgramId, guideProgram.Title, guideProgram.SubTitle, guideProgram.EpisodeNumberDisplay, guideProgram.StartTime, scheduleType, upcomingProgram, upcomingGuideProgram); _programContextMenuStrip.Show(_channelsGridView, e.Location); } } } } }