Ejemplo n.º 1
0
        private void MergedLineupGridView_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            Comparison <MergedChannel> old_sort = current_sort_;
            Comparison <MergedChannel> new_sort = null;
            MergedChannelGridColumn    column   = MergedChannelColumnToEnum(e.ColumnIndex);

            switch (column)
            {
            case MergedChannelGridColumn.Number:
            case MergedChannelGridColumn.SubNumber:
                new_sort = CompareChannelNumbers;
                break;

            case MergedChannelGridColumn.Listing:
                new_sort = CompareListing;
                break;

            case MergedChannelGridColumn.Type:
                new_sort = CompareChannelType;
                break;

            case MergedChannelGridColumn.TunerCount:
                new_sort = CompareTunerCount;
                break;

            case MergedChannelGridColumn.Visibility:
                new_sort = CompareVisibility;
                break;

            case MergedChannelGridColumn.UserBlockedState:
                new_sort = CompareUserBlockedState;
                break;

            case MergedChannelGridColumn.Encrypted:
                new_sort = CompareEncrypted;
                break;

            case MergedChannelGridColumn.HD:
                new_sort = CompareHD;
                break;

            case MergedChannelGridColumn.InBand:
                new_sort = CompareInBand;
                break;
            }
            if (new_sort == null)
            {
                return;
            }
            reverse_sort_ = (new_sort == old_sort) && !reverse_sort_;
            current_sort_ = new_sort;
            SortChannels();
            MergedLineupGridView.Invalidate();
        }
Ejemplo n.º 2
0
        private void SelectAndLoadLineup(MergedLineup lineup)
        {
            merged_lineup_ = lineup;
            Channel[] channels      = merged_lineup_.GetChannels();
            int       channel_count = channels.Length;

            merged_channels_ = new List <MergedChannel>();
            foreach (Channel ch in channels.Distinct())
            {
                merged_channels_.Add((MergedChannel)ch);
            }
            SortChannels();
            MergedLineupGridView.RowCount = merged_channels_.Count;
            MergedLineupGridView.Invalidate();
        }