void OnSimulatorClick(object sender, EventArgs e) { OPMButton btn = (sender as OPMButton); if (btn != null) { //WmCopyDataSender.SendData("EmulatorInputPin", btn.Tag as string); IPCRemoteControlProxy.PostRequest("EmulatorInputPin", btn.Tag as string); } pnlContent.Select(); pnlContent.Focus(); }
public static void SendPlayerCommand(BasicCommand command, bool useIpc = false) { ThreadPool.QueueUserWorkItem(c => { int i = 0; bool playerWasAlreadyRunning = IsPlayerRunning(); if (!useIpc) { // See if player is started; if not - start it while ((!IsPlayerRunning() && i < MaxStartupAttempts)) { Process.Start(ProTONEConfig.PlayerInstallationPath); i++; Thread.Sleep(1000); } } if (IsPlayerRunning()) { if (!playerWasAlreadyRunning) { Thread.Sleep(400); } //// If we came to this poin the player is running. //// Send the command (it should arrive to player). if (useIpc) { IPCRemoteControlProxy.PostRequest(ProTONEConstants.PlayerName, command.ToString()); } else { WmCopyDataSender.SendData(ProTONEConstants.PlayerName, command.ToString()); } } else { if (useIpc) { Logger.LogError("Could not send command because the player is not running."); } else { Logger.LogError("Could not send command because the player could not be launched from path: {0}", ProTONEConfig.PlayerInstallationPath); } } } ); }