/// <summary> /// Occurs when disable hosts clicked. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="e"> /// The event arguments. /// </param> private void OnDisableHostsClick(object sender, EventArgs e) { bool checkState = (sender as dynamic).Checked; if (checkState) { HostsFile.EnableHostsFile(); } else { HostsFile.DisableHostsFile(); } this.UpdateHostsFileState(); }
/// <summary> /// Occurs when disable hosts clicked. /// </summary> /// <param name="sender"> /// The sender. /// </param> /// <param name="e"> /// The event arguments. /// </param> private void OnDisableHostsClick(object sender, EventArgs e) { bool checkState = (sender as dynamic).Checked; this.menuDisable.Checked = !checkState; this.buttonDisable.Checked = !checkState; if (checkState) { HostsFile.EnableHostsFile(); } else { HostsFile.DisableHostsFile(); } }