Exemplo n.º 1
0
        private void RemoveSourceChannelButton_Click(object sender, EventArgs e)
        {
            int row_index = SubChannelsGrid.CurrentRow.Index;

            if (row_index < 0 || row_index >= subchannels_.Count)
            {
                return;
            }
            Channel subchannel = subchannels_[row_index];

            ChannelEditing.RemoveSubChannel(merged_channel_, subchannel, false);
            RefreshSubchannelsGrid();
        }
Exemplo n.º 2
0
        private void SubChannelsGrid_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0 || e.RowIndex >= subchannels_.Count)
            {
                return;
            }
            Channel subchannel             = subchannels_[e.RowIndex];
            CurrentSourceGridColumn column = CurrentSourceColumnFromIndex(e.ColumnIndex);

            switch (column)
            {
            case CurrentSourceGridColumn.Remove:
                ChannelEditing.RemoveSubChannel(merged_channel_, subchannel, false);
                RefreshSubchannelsGrid();
                break;

            case CurrentSourceGridColumn.Promote:
                if (e.RowIndex > 0)
                {
                    SwapSubChannelRows(e.RowIndex, e.RowIndex - 1);
                }
                break;

            case CurrentSourceGridColumn.Demote:
                if (e.RowIndex < subchannels_.Count - 1)
                {
                    SwapSubChannelRows(e.RowIndex, e.RowIndex + 1);
                }
                break;

            case CurrentSourceGridColumn.InheritCallsign:
                merged_channel_.CallSign = subchannel.CallSign;
                merged_channel_.Update();
                break;

            case CurrentSourceGridColumn.InheritListing:
                merged_channel_.Service = subchannel.Service;
                merged_channel_.Update();
                break;
            }
        }