Beispiel #1
0
        void OnChannelMapEntryWrapperStatusChanged(object sender, EventArgs e)
        {
            ChannelMapEntryWrapper wrapper = (ChannelMapEntryWrapper)sender;
            int index = channel_map_.IndexOf(wrapper);

            ChannelMapGrid.InvalidateRow(index);
        }
Beispiel #2
0
        private void ChannelMapGrid_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex < 0 || e.RowIndex >= channel_map_.Count)
            {
                return;
            }
            ChannelMapEntryWrapper entry_wrapper = channel_map_[e.RowIndex];

            switch (ColumnIndexToEnum(e.ColumnIndex))
            {
            case ColumnEnum.Run:
                // GO button was clicked.  Figure out what entry it was, and apply the selected action.
                try
                {
                    entry_wrapper.RunSelectedAction();
                }
                catch (Exception exc)
                {
                    StringBuilder err_description = new StringBuilder();
                    err_description.AppendLine("An error occurred running selected action for channel: ");
                    err_description.AppendLine(entry_wrapper.SerializeForDebug());
                    new ErrorReporter.ErrorReportingForm(err_description.ToString(), exc);
                }
                break;

            case ColumnEnum.ChangeListing:
                DialogResult dr = new ListingSelectionForm(entry_wrapper).ShowDialog();
                ChannelMapGrid.InvalidateRow(e.RowIndex);
                break;
            }
        }
Beispiel #3
0
 private void SortGrid()
 {
     channel_map_.Sort(sort_order_);
     if (is_sort_reversed_)
     {
         channel_map_.Reverse();
     }
     for (int index = 0; index < channel_map_.Count; ++index)
     {
         DataGridViewComboBoxCell cell = ChannelMapGrid.Rows[index].Cells[ActionCol.Index] as DataGridViewComboBoxCell;
         cell.Value = null;
         cell.Items.Clear();
         foreach (CorrectiveAction action in channel_map_[index].GetCorrectiveActions())
         {
             cell.Items.Add(action);
         }
         cell.Value = channel_map_[index].selected_action;
     }
     ChannelMapGrid.Invalidate();
 }
Beispiel #4
0
 private void RecommendedActionButton_Click(object sender, EventArgs e)
 {
     ChannelMapEntryWrapper.SelectDefaultActions();
     ChannelMapGrid.Invalidate(true);
 }
Beispiel #5
0
 private void NoActionButton_Click(object sender, EventArgs e)
 {
     ChannelMapEntryWrapper.ClearSelectedActions();
     ChannelMapGrid.Invalidate(true);
 }