Exemple #1
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;
            }
        }
Exemple #2
0
        private void AvailLineupGridView_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            Comparison <Channel>      old_sort = current_avail_sort_;
            AvailableSourceGridColumn column   = AvailableSourceColumnFromIndex(e.ColumnIndex);
            Comparison <Channel>      new_sort = null;

            switch (column)
            {
            case AvailableSourceGridColumn.Number:
                new_sort = MainForm.CompareChannelNumbers;
                break;

            case AvailableSourceGridColumn.Type:
                new_sort = MainForm.CompareChannelType;
                break;

            case AvailableSourceGridColumn.TunerCount:
                new_sort = MainForm.CompareTunerCount;
                break;

            case AvailableSourceGridColumn.Callsign:
                new_sort = CompareCallsign;
                break;

            case AvailableSourceGridColumn.Listing:
                new_sort = MainForm.CompareListing;
                break;

            case AvailableSourceGridColumn.TuningParams:
                new_sort = MainForm.CompareTuningParams;
                break;
            }
            if (new_sort == null)
            {
                return;
            }
            reverse_avail_sort_ = (new_sort == old_sort) && !reverse_avail_sort_;
            current_avail_sort_ = new_sort;
            SortAvailChannels();
        }
Exemple #3
0
        private void AvailLineupGridView_CellContentClick(object sender, DataGridViewCellEventArgs 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.AddFirst:
                ChannelEditing.AddScannedChannelToMergedChannel(ch, merged_channel_, true);
                RefreshSubchannelsGrid();
                break;

            case AvailableSourceGridColumn.AddLast:
                ChannelEditing.AddScannedChannelToMergedChannel(ch, merged_channel_, false);
                RefreshSubchannelsGrid();
                break;
            }
        }