Exemplo n.º 1
0
        private void ScannedLineupGridView_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
        {
            if (e.RowIndex < 0 || e.RowIndex >= scanned_channels_.Count)
            {
                return;
            }
            Channel           ch     = scanned_channels_[e.RowIndex];
            ScannedGridColumn column = ScannedColumnToEnum(e.ColumnIndex);

            switch (column)
            {
            case ScannedGridColumn.Logo:
                try
                {
                    e.Value = GetChannelLogo(ch);
                }
                catch
                {
                    e.Value = new Bitmap(5, 5);
                }
                break;

            case ScannedGridColumn.Number:
                e.Value = ch.DisplayChannelNumber;
                break;

            case ScannedGridColumn.Listing:
                e.Value = ch.Service.Name + ":" + ch.Service.Provider.Name;
                break;

            case ScannedGridColumn.Type:
                e.Value = ch.ChannelType.ToString();
                break;

            case ScannedGridColumn.TunerCount:
                e.Value = ChannelEditing.GetTunerCount(ch);
                break;

            case ScannedGridColumn.Encrypted:
                e.Value = IsScannedEncrypted(ch);
                break;

            case ScannedGridColumn.TuningParams:
                if (ch.TuningInfos != null && !ch.TuningInfos.Empty)
                {
                    e.Value = ChannelEditing.GetTuningParamsAsString(ch.TuningInfos.First);
                }
                else
                {
                    e.Value = "No tuning infos";
                }
                break;

            case ScannedGridColumn.Callsign:
                e.Value = ch.CallSign;
                break;
            }
        }
Exemplo n.º 2
0
        internal static int CompareTuningParams(Channel ch1, Channel ch2)
        {
            bool ch1_has_tuning_info = ch1.TuningInfos != null && !ch1.TuningInfos.Empty;
            bool ch2_has_tuning_info = ch2.TuningInfos != null & !ch2.TuningInfos.Empty;

            if (ch1_has_tuning_info && ch2_has_tuning_info)
            {
                return(ChannelEditing.GetTuningParamsAsString(ch1.TuningInfos.First).CompareTo(
                           ChannelEditing.GetTuningParamsAsString(ch2.TuningInfos.First)));
            }
            else
            {
                return(ch1_has_tuning_info.CompareTo(ch2_has_tuning_info));
            }
        }
Exemplo n.º 3
0
        private void AvailLineupGridView_CellValueNeeded(object sender, DataGridViewCellValueEventArgs e)
        {
            if (e.RowIndex < 0 || e.RowIndex >= avail_channels_.Count())
            {
                return;
            }
            Channel ch = avail_channels_[e.RowIndex];
            AvailableSourceGridColumn column = AvailableSourceColumnFromIndex(e.ColumnIndex);

            switch (column)
            {
            case AvailableSourceGridColumn.Callsign:
                e.Value = ch.CallSign;
                break;

            case AvailableSourceGridColumn.Listing:
                e.Value = ch.Service;
                break;

            case AvailableSourceGridColumn.Number:
                e.Value = ch.DisplayChannelNumber;
                break;

            case AvailableSourceGridColumn.TunerCount:
                e.Value = ChannelEditing.GetTunerCount(ch);
                break;

            case AvailableSourceGridColumn.Type:
                e.Value = ch.ChannelType;
                break;

            case AvailableSourceGridColumn.TuningParams:
                if (ch.TuningInfos != null && !ch.TuningInfos.Empty)
                {
                    e.Value = ChannelEditing.GetTuningParamsAsString(ch.TuningInfos.First);
                }
                else
                {
                    e.Value = "No tuning infos";
                }
                break;
            }
        }