public ProgramEventArgs(GuideProgramSummary guideProgram, Channel channel, Point location) { this.GuideProgram = guideProgram; this.Channel = channel; this.Location = location; this.UpcomingProgramId = guideProgram.GetUniqueUpcomingProgramId(channel.ChannelId); }
internal void InsertProgram(GuideProgramSummary guideProgram) { if (!_programs.ContainsKey(guideProgram.StartTime) && !ContainsProgram(guideProgram.GuideProgramId)) { _programs.Add(guideProgram.StartTime, guideProgram); } }
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 _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); } } } }
private string GetProgramDescription(GuideProgramSummary program) { return(program.StartTime.ToShortTimeString() + " - " + program.StopTime.ToShortTimeString() + " " + program.CreateProgramTitle()); }