private void _tvChannelProgramsControl_MouseUp(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { DataGridView.HitTestInfo htinfo = _tvChannelProgramsControl.HitTest(e.X, e.Y); if (htinfo.Type == DataGridViewHitTestType.Cell) { ChannelProgramView programView = _tvChannelProgramsControl.Rows[htinfo.RowIndex].DataBoundItem as ChannelProgramView; if (programView != null) { GuideUpcomingProgram upcomingProgramInfo = null; _model.AllUpcomingGuidePrograms.TryGetValue(programView.UpcomingProgramId, out upcomingProgramInfo); _tvChannelProgramsControl.Rows[htinfo.RowIndex].Selected = true; ScheduleType? scheduleType = null; UpcomingProgram upcomingProgram = null; UpcomingGuideProgram upcomingGuideProgram = null; if (upcomingProgramInfo != null && upcomingProgramInfo.ChannelId == programView.Program.Channel.ChannelId) { scheduleType = upcomingProgramInfo.Type; upcomingProgram = upcomingProgramInfo.UpcomingRecording != null ? upcomingProgramInfo.UpcomingRecording.Program : null; upcomingGuideProgram = upcomingProgramInfo.UpcomingGuideProgram; } _programContextMenuStrip.SetTarget(programView.Program.Channel, programView.Program.GuideProgramId, programView.Title, programView.SubTitle, programView.EpisodeNumberDisplay, programView.StartTime, scheduleType, upcomingProgram, upcomingGuideProgram); _programContextMenuStrip.Show(_tvChannelProgramsControl, e.Location); } } } }
private void SetTarget(Channel channel, Guid?guideProgramId, string title, string subTitle, string episodeNumberDisplay, DateTime startTime, ScheduleType?scheduleType, UpcomingProgram upcomingProgram, UpcomingGuideProgram upcomingGuideProgram, ActiveRecording activeRecording) { _channel = channel; _guideProgramId = guideProgramId; _title = title; _subTitle = subTitle; _episodeNumberDisplay = episodeNumberDisplay; _startTime = startTime; _scheduleType = scheduleType; _upcomingProgram = upcomingProgram; _activeRecording = activeRecording; _upcomingGuideProgram = upcomingGuideProgram; }
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); } } } } }
private void _epgControl_ProgramContextMenu(object sender, ArgusTV.WinForms.Controls.EpgControl.ProgramEventArgs e) { ScheduleType? scheduleType = null; UpcomingProgram upcomingProgram = null; UpcomingGuideProgram upcomingGuideProgram = null; GuideUpcomingProgram upcomingProgramInfo; if (_model.UpcomingRecordingsById.TryGetValue(e.UpcomingProgramId, out upcomingProgramInfo) || _model.UpcomingAlertsById.TryGetValue(e.UpcomingProgramId, out upcomingProgramInfo) || _model.UpcomingSuggestionsById.TryGetValue(e.UpcomingProgramId, out upcomingProgramInfo)) { scheduleType = upcomingProgramInfo.Type; upcomingProgram = upcomingProgramInfo.UpcomingRecording != null ? upcomingProgramInfo.UpcomingRecording.Program : null; upcomingGuideProgram = upcomingProgramInfo.UpcomingGuideProgram; } _programContextMenuStrip.SetTarget(e.Channel, e.GuideProgram.GuideProgramId, e.GuideProgram.Title, e.GuideProgram.SubTitle, e.GuideProgram.EpisodeNumberDisplay, e.GuideProgram.StartTime, scheduleType, upcomingProgram, upcomingGuideProgram); _programContextMenuStrip.Show(_epgControl, e.Location); }
public void SetTarget(Channel channel, Guid?guideProgramId, string title, string subTitle, string episodeNumberDisplay, DateTime startTime, ScheduleType?scheduleType, UpcomingProgram upcomingProgram, UpcomingGuideProgram upcomingGuideProgram) { SetTarget(channel, guideProgramId, title, subTitle, episodeNumberDisplay, startTime, scheduleType, upcomingProgram, upcomingGuideProgram, null); }
public GuideUpcomingProgram(ScheduleType type, UpcomingGuideProgram upcomingGuideProgram) { _type = type; _upcomingGuideProgram = upcomingGuideProgram; }