private void bt_replace_Click(object sender, EventArgs e) { switch (nowShowType) { case ShowRuleCollectionType.RemoteRule: case ShowRuleCollectionType.SharedRule: if (nowRuleDetails == null) { MyHelper.MyGlobalHelper.markControlService.MarkControl(watermakTextBox_ruleToken, System.Drawing.Color.Pink, 2); MessageBox.Show("please select share rule first", "Stop", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } if (MessageBox.Show("This operation will removes all local rules and replace with the remote rules \r\nwhether to confirm ", "Confirm", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK) { mainWindow.ReplaceRuleStorage(nowRuleDetails); MessageBox.Show("Complete the replacement rule", "Complete", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } break; default: MessageBox.Show("Unknow state", "Stop", MessageBoxButtons.OK, MessageBoxIcon.Stop); break; } }
private void bt_replaceRule_Click(object sender, EventArgs e) { if (nowRuleDetails == null) { MessageBox.Show("please get remore rule first", "Stop", MessageBoxButtons.OK, MessageBoxIcon.Stop); return; } mainWindow.ReplaceRuleStorage(nowRuleDetails); this.Close(); }