public DNSMasqHost ShowDnsRuleDialog() { DNSMasqHost h = new DNSMasqHost(); DialogResult res; res = this.ShowDialog(); if (res == DialogResult.OK) { if (textBox_hostname.Text == String.Empty) { return(null); } h.name = textBox_hostname.Text; if (textBox_arec.Text != String.Empty) { h.a = textBox_arec.Text; } if (textBox_aaaarec.Text != String.Empty) { h.aaaa = textBox_aaaarec.Text; } } else if (res == DialogResult.Cancel) { h = null; } return(h); }
private void addRule_Click(object sender, EventArgs e) { PromptRuleAdd pra = new PromptRuleAdd(); DNSMasqHost newHost = pra.ShowDnsRuleDialog(); if (newHost == null) { return; } m_log.WriteLine("[+] Added new rule for " + newHost.name + ": a=" + newHost.a + " aaaa=" + newHost.aaaa); m_server.AddMasq(newHost); set_status_modified(true); }