void PerformInjection() { AutoResetEvent injectionEvent = new AutoResetEvent(false); string[] processNames = new string[] { "WW1" }; foreach (string processName in processNames) { //processName Task.Run(delegate() { InjectionManager.Monitor(processName, Resources.WarplanesWW1Telemetry, injectionEvent, "WarplanesWW1Telemetry"); }); } while (true) { injectionEvent.WaitOne(); ui.StatusTextChanged(InjectionManager.GetStatus()); if (InjectionManager.GetState() == InjectionManager.State.Failed || InjectionManager.GetState() == InjectionManager.State.Success) { break; } } }
void PerformInjection() { AutoResetEvent injectionEvent = new AutoResetEvent(false); string[] processNames = new string[] { "NascarHeat5", "NascarHeat4", "AllAmericanRacing", "SprintCarRacing" }; foreach (string processName in processNames) { //processName Task.Run(delegate() { InjectionManager.Monitor(processName, Resources.MonsterGamesTelemetry, injectionEvent, "MonsterGamesTelemetry"); }); } while (true) { injectionEvent.WaitOne(); ui.StatusTextChanged(InjectionManager.GetStatus()); if (InjectionManager.GetState() == InjectionManager.State.Failed || InjectionManager.GetState() == InjectionManager.State.Success) { break; } } }