private void linkResendTo_Click(object sender, EventArgs e) { if (linkResendTo.Visible == false) { return; } if (listGroupDetail.SelectedItems.Count == 0) { return; } PerformanceInfo info = (listGroupDetail.SelectedItems[0].Tag as PerformanceInfo); if (info.HttpInfo != null) { if (string.IsNullOrEmpty(info.HttpInfo.Url) == false // 单独排除 LoadData ,避免被正则表达式判断为匹配 adD ,误解为 add && info.HttpInfo.Url.IndexOf("LoadData", StringComparison.OrdinalIgnoreCase) < 0 && s_regex.IsMatch(info.HttpInfo.Url) ) { if (MessageBox.Show("当前请求可能会修改数据库,确定要重发请求吗?", this.FindForm().Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No) { return; } } EventHandler <ReSendEventArgs> eventHandler = this.ReSendButtonClick; if (eventHandler != null) { ReSendEventArgs args = new ReSendEventArgs { RequestRaw = info.HttpInfo.RequestText.Value.Trim(' ', '\r', '\n') }; eventHandler(linkResendTo, args); } } }
private void LogSearchControl1_ReSendButtonClick(object sender, ReSendEventArgs e) { tabControl1.SelectedTab = this.tabPage2; sendRequestControl1.SetRequestRaw(e.RequestRaw); }