コード例 #1
0
        public void OnGrabberSelected(Object source, GrabberSelectedEventArgs e)
        {
            //this.Activate(); -> form control
            GrabberSelectionInfo id = e.Selection;

            if (tcMappingDetails.SelectedIndex == 0) // single mapping
            {
                if (id != null)
                {
                    if (UpdateGrabberDetails(id.ChannelId, id.GrabberId))
                    {
                        foreach (ListViewItem channel in lvMapping.SelectedItems)
                        {
                            if (_channelMapping.ContainsKey(channel.Text))
                            {
                                ChannelMap channelMap = _channelMapping[channel.Text];
                                channelMap.id      = id.ChannelId;
                                channelMap.grabber = id.GrabberId;
                                _channelMapping.Remove(channel.Text);
                                _channelMapping.Add(channel.Text, channelMap);
                            }
                        }
                    }

                    UpdateList();
                }
            }
            else // merged mapping
            {
                DataGridViewRow row = null;
                if (dgvMerged.SelectedRows.Count == 1)
                {
                    row = dgvMerged.SelectedRows[0];
                }
                else
                {
                    row = dgvMerged.CurrentRow;
                }
                if (row != null)
                {
                    //MergedChannel channelDetails = (MergedChannel)dgvMerged.SelectedRows[0].DataBoundItem;
                    //dgvMerged.BeginEdit(false);
                    dgvMerged.CurrentCell = row.Cells["idColumn"];
                    dgvMerged.NotifyCurrentCellDirty(true);
                    dgvMerged.NotifyCurrentCellDirty(false);
                    row.Cells["idColumn"].Value      = id.ChannelId;
                    row.Cells["grabberColumn"].Value = id.GrabberId;
                    //dgvMerged.EndEdit();
                }
            }
        }
コード例 #2
0
        public void DoSelect(Object source, GrabberSelectedEventArgs e)
        {
            this.Activate();
            GrabberSelectionInfo id = e.Selection;

            if (id != null)
            {
                tbChannelName.Text = id.ChannelId;
                tbGrabSite.Text    = id.GrabberId;
            }

            this.BringToFront();
            //_selection.Close();
        }
コード例 #3
0
    public void OnGrabberSelected(Object source, GrabberSelectedEventArgs e)
    {
      //this.Activate(); -> form control
      GrabberSelectionInfo id = e.Selection;
      if (tcMappingDetails.SelectedIndex == 0) // single mapping
      {
        if (id != null)
        {
          if (UpdateGrabberDetails(id.ChannelId, id.GrabberId))
          {
            foreach (ListViewItem channel in lvMapping.SelectedItems)
            {
              if (_channelMapping.ContainsKey(channel.Text))
              {
                ChannelMap channelMap = _channelMapping[channel.Text];
                channelMap.id = id.ChannelId;
                channelMap.grabber = id.GrabberId;
                _channelMapping.Remove(channel.Text);
                _channelMapping.Add(channel.Text, channelMap);
              }
            }
          }

          UpdateList();
        }
      }
      else // merged mapping
      {
        DataGridViewRow row = null;
        if (dgvMerged.SelectedRows.Count == 1)
        {
          row = dgvMerged.SelectedRows[0];
        }
        else
        {
          row = dgvMerged.CurrentRow;
        }
        if (row != null)
        {
          //MergedChannel channelDetails = (MergedChannel)dgvMerged.SelectedRows[0].DataBoundItem;
          //dgvMerged.BeginEdit(false);
          dgvMerged.CurrentCell = row.Cells["idColumn"];
          dgvMerged.NotifyCurrentCellDirty(true);
          dgvMerged.NotifyCurrentCellDirty(false);
          row.Cells["idColumn"].Value = id.ChannelId;
          row.Cells["grabberColumn"].Value = id.GrabberId;
          //dgvMerged.EndEdit();
        }
      }
    }
コード例 #4
0
    public void DoSelect(Object source, GrabberSelectedEventArgs e)
    {
      this.Activate();
      GrabberSelectionInfo id = e.Selection;

      if (id != null)
      {
        tbChannelName.Text = id.ChannelId;
        tbGrabSite.Text = id.GrabberId;
      }

      this.BringToFront();
      //_selection.Close();
    }
コード例 #5
0
 private void DoSelect(Object source, GrabberSelectedEventArgs e)
 {
   GrabberSelectionInfo id = e.Selection;
   switch (tabMain.SelectedIndex)
   {
     case 1:
       TvMappings.OnGrabberSelected(source, e);
       break;
     case 2:
       RadioMappings.OnGrabberSelected(source, e);
       break;
   }
 }