private void _programsDataGridView_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e) { foreach (DataGridViewRow row in _programsDataGridView.Rows) { Icon icon = Properties.Resources.TransparentIcon; string toolTip = null; UpcomingOrActiveProgramView programView = row.DataBoundItem as UpcomingOrActiveProgramView; if (programView != null) { ProgramIconUtility.GetIconAndToolTip(_scheduleType, programView.CancellationReason, programView.IsPartOfSeries, this.UnfilteredUpcomingRecordings ?? this.UpcomingPrograms, programView.UpcomingRecording, out icon, out toolTip); if (programView.UpcomingRecording != null && programView.CancellationReason == UpcomingCancellationReason.None) { row.Cells[2].ToolTipText = ProcessUtility.BuildRecordingInfoToolTip(programView.UpcomingRecording, "on"); } else if (programView.ActiveRecording != null && programView.CancellationReason == UpcomingCancellationReason.None) { row.Cells[2].ToolTipText = ProcessUtility.BuildRecordingInfoToolTip(programView.ActiveRecording, "on"); } else { row.Cells[2].ToolTipText = null; } } row.Cells[0].Value = icon; row.Cells[0].ToolTipText = toolTip; } }
public ProgramContextMenuStrip() { _isTerminalServicesSession = GetSystemMetrics(SM_REMOTESESSION); Icon recordIcon = ProgramIconUtility.GetIcon(ScheduleType.Recording, false); Icon recordSeriesIcon = ProgramIconUtility.GetIcon(ScheduleType.Recording, true); _recordItem = AddItem(this.Items, recordIcon, "Record"); _recordDailyItem = AddItem(this.Items, recordSeriesIcon, "Record Daily"); _recordWeeklyItem = AddItem(this.Items, recordSeriesIcon, "Record Weekly"); _recordAnyTimeItem = AddItem(this.Items, recordSeriesIcon, "Record Any Time"); _playWithVlcItem = AddItem(this.Items, "Play Recording With VLC"); _abortRecordingItem = AddItem(this.Items, Properties.Resources.RecordCancelledIcon, "Abort Recording"); _separator1 = AddSeparator(this.Items); _priorityScheduleItem = AddItem(this.Items, "Priority"); AddItem(_priorityScheduleItem.DropDownItems, "Very Low", UpcomingProgramPriority.VeryLow); AddItem(_priorityScheduleItem.DropDownItems, "Low", UpcomingProgramPriority.Low); AddItem(_priorityScheduleItem.DropDownItems, "Normal", UpcomingProgramPriority.Normal); AddItem(_priorityScheduleItem.DropDownItems, "High", UpcomingProgramPriority.High); AddItem(_priorityScheduleItem.DropDownItems, "Very High", UpcomingProgramPriority.VeryHigh); AddItem(_priorityScheduleItem.DropDownItems, "Highest", UpcomingProgramPriority.Highest); AddSeparator(_priorityScheduleItem.DropDownItems); _resetToSchedulePriorityItem = AddItem(_priorityScheduleItem.DropDownItems, Properties.Resources.Reset, "Reset To Schedule Priority"); _preRecordScheduleItem = AddItem(this.Items, "Pre-record"); _postRecordScheduleItem = AddItem(this.Items, "Post-record"); _separator2 = AddSeparator(this.Items); _editScheduleItem = AddItem(this.Items, Properties.Resources.EditProfile, "Edit Schedule"); _deleteScheduleItem = AddItem(this.Items, Properties.Resources.RemoveProfile, "Delete Schedule"); _cancelProgramItem = AddItem(this.Items, Properties.Resources.RecordSeriesCancelledIcon, "Cancel This Program"); _uncancelProgramItem = AddItem(this.Items, Properties.Resources.RecordSeriesIcon, "Uncancel This Program"); _addToPreviouslyRecordedHistoryItem = AddItem(this.Items, Properties.Resources.RecordSeriesCancelledHistoryIcon, "Add To Previously Recorded History"); _removeFromPreviouslyRecordedHistoryItem = AddItem(this.Items, Properties.Resources.RecordSeriesIcon, "Remove From Previously Recorded History"); }
private void _schedulesDataGridView_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e) { foreach (DataGridViewRow row in _schedulesDataGridView.Rows) { Icon icon = Properties.Resources.TransparentIcon; ScheduleSummary schedule = row.DataBoundItem as ScheduleSummary; if (schedule != null) { icon = ProgramIconUtility.GetIcon(_scheduleType, !schedule.IsOneTime); } DataGridViewImageCell cell = (DataGridViewImageCell)row.Cells[1]; cell.Value = icon; cell.ValueIsIcon = true; } }
private void SetCellIcon(DataGridViewRow row, int columnIndex, Channel channel, Guid?upcomingProgramId) { Icon icon = Properties.Resources.TransparentIcon; string toolTip = null; if (upcomingProgramId.HasValue && _allUpcomingGuidePrograms.ContainsKey(upcomingProgramId.Value)) { GuideUpcomingProgram programInfo = _allUpcomingGuidePrograms[upcomingProgramId.Value]; ProgramIconUtility.GetIconAndToolTip(programInfo.Type, programInfo.CancellationReason, programInfo.IsPartOfSeries, _allUpcomingGuidePrograms.UpcomingRecordings, programInfo.UpcomingRecording, out icon, out toolTip); } row.Cells[columnIndex].Value = icon; row.Cells[columnIndex].ToolTipText = toolTip; }
private bool DrawScheduleIcon(GuideProgramCell cell, PaintEventArgs e, float titleTop, ref int titleLeft, SerializableDictionary <Guid, GuideUpcomingProgram> upcomingById) { GuideUpcomingProgram upcomingProgramInfo; if (upcomingById.TryGetValue(cell.GetUniqueUpcomingProgramId(), out upcomingProgramInfo)) { Icon icon; string toolTip = null; if (upcomingProgramInfo.UpcomingRecording != null) { toolTip = ProcessUtility.BuildRecordingInfoToolTip(upcomingProgramInfo.UpcomingRecording, "on"); } string toolTip2; ProgramIconUtility.GetIconAndToolTip(upcomingProgramInfo.Type, upcomingProgramInfo.CancellationReason, upcomingProgramInfo.IsPartOfSeries, _model.UpcomingRecordings, upcomingProgramInfo.UpcomingRecording, out icon, out toolTip2); if (!String.IsNullOrEmpty(toolTip2)) { if (!String.IsNullOrEmpty(toolTip)) { toolTip = toolTip + Environment.NewLine + Environment.NewLine + toolTip2; } else { toolTip = toolTip2; } } Rectangle iconRectangle = new Rectangle(titleLeft, (int)Math.Round(titleTop), icon.Width, icon.Height); if (!String.IsNullOrEmpty(toolTip)) { cell.ToolTips.Add(new CellToolTip(iconRectangle, toolTip)); } int height = (int)(icon.Height * _heightFactor); e.Graphics.DrawIcon(icon, iconRectangle.X, iconRectangle.Y + (int)Math.Floor((height - icon.Height) / 2.0)); titleLeft += icon.Width; return(true); } return(false); }