private void btnFactoryDefaultConfig_Click(object sender, RoutedEventArgs e) { if (!MessageConfirm("把主板设定重置为出厂设定?")) { return; } if (UBT.DefaultConfig()) { if (UBT.GetConfig()) { RefreshBoardConfig(); } else { UpdateInfo("Fail reading board config"); } MessageBox.Show("系统设定已还原为出厂设定.\n部份设定必须在重启时才生效.\n为确保系统的稳定性, 请即重启机器人.", "系统设定还原成功", MessageBoxButton.OK, MessageBoxImage.Warning); } else { UpdateInfo("Fail resetting config to factory default"); } }