private void DoSelect(Object source, EventArgs e)
 {
     if (GrabberSelected != null)
     {
         GrabberSelectionInfo selection = Selected;
         if (selection != null)
         {
             GrabberSelected(this, new GrabberSelectedEventArgs(Selected));
         }
     }
 }
        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();
                }
            }
        }
        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();
        }
        private TreeNode FindNode(TreeNode tNode, GrabberSelectionInfo tag)
        {
            tNode.Expand();
            foreach (TreeNode cNode in tNode.Nodes)
            {
                TreeNode rNode = FindNode(cNode, tag);
                if (rNode != null)
                {
                    return(rNode);
                }
            }

            GrabberSelectionInfo ntag = (GrabberSelectionInfo)tNode.Tag;

            if (ntag != null && ntag.ChannelId == tag.ChannelId && ntag.GrabberId == tag.GrabberId)
            {
                return(tNode);
            }

            tNode.Collapse();
            return(null);
        }
 public GrabberSelectedEventArgs(string channelId, string grabberId)
 {
     Selection = new GrabberSelectionInfo(channelId, grabberId);
 }
 public GrabberSelectedEventArgs(GrabberSelectionInfo selection)
 {
     Selection = selection;
 }
Esempio n. 7
0
 public GrabberSelectedEventArgs(string channelId, string grabberId)
 {
   Selection = new GrabberSelectionInfo(channelId, grabberId);
 }
Esempio n. 8
0
 public GrabberSelectedEventArgs(GrabberSelectionInfo selection)
 {
   Selection = selection;
 }
Esempio n. 9
0
    private TreeNode FindNode(TreeNode tNode, GrabberSelectionInfo tag)
    {
      tNode.Expand();
      foreach (TreeNode cNode in tNode.Nodes)
      {
        TreeNode rNode = FindNode(cNode, tag);
        if (rNode != null)
        {
          return rNode;
        }
      }

      GrabberSelectionInfo ntag = (GrabberSelectionInfo)tNode.Tag;
      if (ntag != null && ntag.ChannelId == tag.ChannelId && ntag.GrabberId == tag.GrabberId)
      {
        return tNode;
      }

      tNode.Collapse();
      return null;
    }