private void STDeditclick(object sender, MouseButtonEventArgs e) { STDConfigurationDetail fw = new STDConfigurationDetail(); string protocol = (STDdataGrid.SelectedItem as STDRuleDataTable).protocol; string[] srcIP = (STDdataGrid.SelectedItem as STDRuleDataTable).srcIP.ToString().Split('.'); string[] dstIP = (STDdataGrid.SelectedItem as STDRuleDataTable).dstIP.ToString().Split('.'); string sport = (STDdataGrid.SelectedItem as STDRuleDataTable).sport; string dport = (STDdataGrid.SelectedItem as STDRuleDataTable).dport; bool log = (STDdataGrid.SelectedItem as STDRuleDataTable).log; if (srcIP[0] != "") { fw.srcStarttextBox_1.Text = srcIP[0]; fw.srcStarttextBox_2.Text = srcIP[1]; fw.srcStarttextBox_3.Text = srcIP[2]; fw.srcStarttextBox_4.Text = srcIP[3]; } if (dstIP[0] != "") { fw.dstStarttextBox_1.Text = dstIP[0]; fw.dstStarttextBox_2.Text = dstIP[1]; fw.dstStarttextBox_3.Text = dstIP[2]; fw.dstStarttextBox_4.Text = dstIP[3]; } fw.sportBox.Text = sport; fw.dportBox.Text = dport; fw.logcheckBox.IsChecked = log; StaticGlobal.selectedindex = StaticGlobal.FireWalldevices[StaticGlobal.firewallindex].getCNCRule_list().IndexOf(CNCdataGrid.SelectedItem as CNCRuleDataTable); StaticGlobal.editflag = true; fw.ShowDialog(); }
/*状态检测STD选项卡*/ private void NewSTDRulebutton_Click(object sender, RoutedEventArgs e) { StaticGlobal.editflag = false; STDConfigurationDetail fw = new STDConfigurationDetail(); fw.ShowDialog(); }