private void distanceTriggerToolStripMenuItem_Click(object sender, EventArgs e) { bool triggerEnabled = Fritz.Properties.Settings.Default.Trigger_Enabled; bool triggerCheckSonar = Fritz.Properties.Settings.Default.Trigger_Check_Sonar; bool triggerCheckIR = Fritz.Properties.Settings.Default.Trigger_Check_IR; int triggerDistance = Fritz.Properties.Settings.Default.Trigger_Distance; DistanceTrigger dlg = new DistanceTrigger(); dlg.Set(triggerEnabled, triggerCheckSonar, triggerCheckIR, triggerDistance); dlg.ShowDialog(); if (dlg.DialogResult == DialogResult.OK) { conductor.SetDistanceTrigger(triggerEnabled = dlg.IsEnabled(), triggerCheckSonar = dlg.CheckSonar(), triggerCheckIR = dlg.CheckIR(), triggerDistance = dlg.GetDistance()); distanceTriggerToolStripMenuItem.Checked = triggerEnabled; Fritz.Properties.Settings.Default.Trigger_Enabled = triggerEnabled; Fritz.Properties.Settings.Default.Trigger_Check_Sonar = triggerCheckSonar; Fritz.Properties.Settings.Default.Trigger_Check_IR = triggerCheckIR; Fritz.Properties.Settings.Default.Trigger_Distance = triggerDistance; Fritz.Properties.Settings.Default.Save(); } }