private void sendCommand_Click(object sender, EventArgs e) { try { InvokeServiceMember("OnCustomCommand", (int)command.Value); } catch (Exception ex) { output.Text = ex.Message + "\r\n"; } }