private string Command(string command, string method, object value) { string result; if (string.Equals(command, "exe")) { switch (method) { case "start": _control.StartRadio(); break; case "stop": _control.StopRadio(); break; case "close": throw new ClientException(); default: throw new MethodException(String.Format("Unknown Exe method: {0}", method)); } result = Response <object>(null, null); } else { bool set = string.Equals(command, "set"); result = METHODS[method].Invoke(set, value); } return(result); }
private void OnJoin(object sender, JoinMessage args) { presence.Party.Size++; presence.Secrets.JoinSecret = args.Secret; MessageBox.Show("OnJoin: " + args.Secret); _control.StopRadio(); _control.RefreshSource(true); Utils.SaveSetting("spyserver.uri", args.Secret); _control.StartRadio(); }
private void startStop(int pegel) { var midiEntry = new MidiEntry(); midiEntry.Startstop = _controlInterface.IsPlaying; if (pegel == 127) { if (midiEntry.Startstop == true) { _controlInterface.StopRadio(); } else { _controlInterface.StartRadio(); } } }