public void update(BindingList <DNSPoisonRecord> pHostnameIPPair) { cDNSPoisonRecords.Clear(); foreach (DNSPoisonRecord lTmp in pHostnameIPPair) { cDNSPoisonRecords.Add(new DNSPoisonRecord(lTmp.HostName, lTmp.IPAddress)); } DGV_Spoofing.Refresh(); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void DGV_Spoofing_MouseDown(object sender, MouseEventArgs e) { try { DataGridView.HitTestInfo hti = DGV_Spoofing.HitTest(e.X, e.Y); if (hti.RowIndex >= 0) { DGV_Spoofing.ClearSelection(); DGV_Spoofing.Rows[hti.RowIndex].Selected = true; DGV_Spoofing.CurrentCell = DGV_Spoofing.Rows[hti.RowIndex].Cells[0]; } } catch (Exception) { DGV_Spoofing.ClearSelection(); } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void DGV_Spoofing_MouseUp(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { try { DataGridView.HitTestInfo hti = DGV_Spoofing.HitTest(e.X, e.Y); if (hti.RowIndex >= 0) { CMS_DNSPoison.Show(DGV_Spoofing, e.Location); } } catch (Exception lEx) { cPluginParams.HostApplication.LogMessage(String.Format("{0}: {1}", Config.PluginName, lEx.Message)); } } }