private void btnAIUIConfig_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(tbAppId.Text)) { MessageBox.Show("对不起,请输入AppId!"); return; } if (string.IsNullOrEmpty(tbAppKey.Text)) { MessageBox.Show("对不起,请输入AppKey!"); return; } if (string.IsNullOrEmpty(tbScene.Text)) { MessageBox.Show("对不起,请输入情景模式!"); return; } if (MessageBox.Show("真的要进行吗?", "提示", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes) { //保存配置 SuperObject.Config.SetValue <string>(CONFIG_ID_APPID, tbAppId.Text.Trim()); SuperObject.Config.SetValue <string>(CONFIG_ID_APPKEY, tbAppKey.Text.Trim()); SuperObject.Config.SetValue <string>(CONFIG_ID_Scene, tbScene.Text.Trim()); SuperObject.SaveConfig(); //设置AIUI属性 string configStr = tbAppId.Text.Trim() + "|" + tbAppKey.Text.Trim() + "|" + tbScene.Text.Trim() + "|" + cbIsEnabledUseAIUIAfter.CheckState; MainService.AiuiOnlineService.AiuiConnection.SendAIUIConfigMessage(configStr.Trim()); } }
private void btnSave_Click(object sender, EventArgs e) { if (SaveToConfig()) { //保存配置 SuperObject.SaveConfig(); //重置本地服务 ResetDataService(); MessageBox.Show("保存完成"); Close(); } }
private void ibFree_Click(object sender, EventArgs e) { SuperObject.Config.CurrentGoType = GoType.Free; SwitchButtonState(SuperObject.Config.CurrentGoType); SuperObject.SaveConfig(); if (File.Exists(SuperObject.Config.GoAppPath)) { try { System.Diagnostics.Process.Start(SuperObject.Config.GoAppPath); } catch (Exception ex) { } } }
private void ibUseDevice_Click(object sender, EventArgs e) { SuperObject.Config.CurrentGoType = GoType.Joy; SwitchButtonState(SuperObject.Config.CurrentGoType); SuperObject.SaveConfig(); }
private void ibNormal_Click(object sender, EventArgs e) { SuperObject.Config.CurrentGoType = GoType.Normal; SwitchButtonState(SuperObject.Config.CurrentGoType); SuperObject.SaveConfig(); }