void SetMasterState(bool newMasterState) { if (Properties.Settings.Default.Master != newMasterState) { if (Properties.Settings.Default.Master) { Properties.Settings.Default.Master = newMasterState; NetControl.Start(); } else { Properties.Settings.Default.Master = newMasterState; NetControl.Abort(); } } ShowMasterState(newMasterState); }
private void MainForm_FormClosed(object sender, FormClosedEventArgs e) { NetControl.Abort(); Properties.Settings.Default.Save(); }