private void cmbCommandType_SelectedIndexChanged(object sender, EventArgs e) { lblPlaybackCmd.Visible = false; cmbPlaybackCmd.Visible = false; RC.CommandType cmdType = (RC.CommandType)cmbCommandType.SelectedIndex; if (BasicCommand.RequiresArguments(cmdType)) { switch (cmdType) { case RC.CommandType.Playback: lblPlaybackCmd.Visible = true; cmbPlaybackCmd.Visible = true; break; } } }
private void btnExecute_Click(object sender, EventArgs e) { txtResult.Text = string.Empty; try { RC.CommandType cmdType = (RC.CommandType)cmbCommandType.SelectedIndex; string[] args = null; if (BasicCommand.RequiresArguments(cmdType)) { switch (cmdType) { case RC.CommandType.Playback: args = new string[] { cmbPlaybackCmd.Text }; break; } } string restlt = string.Empty; switch (cmbDestination.SelectedIndex) { case 0: RemoteControlHelper.SendPlayerCommand(cmdType, args); txtResult.Text = "[ Player commands do not return results. ]"; break; case 1: string dest = txtDestinationName.Text; txtResult.Text = RemoteControlHelper.SendServiceCommand(dest, cmdType, args); break; } } catch (Exception ex) { Logger.LogException(ex); txtResult.Text = ex.Message; } }