private void Game_ProcessFound(object sender, ProcessFoundEventArgs e) { if (!Config.Enabled) { return; } _ = SendProcessFoundAsync(e); }
async private Task SendProcessFoundAsync(ProcessFoundEventArgs e) { // always send complete information for this kind of event var body = RequestBody.FromProcessFoundEventArgs(e, di); body.Headers = Config.Headers; await PostJson(RequestBodyToJsonString(body)); }
public static RequestBody FromProcessFoundEventArgs(ProcessFoundEventArgs e, IDiabloInterface di) { return(new RequestBody() { Event = "ProcessFound", D2ProcessInfo = e.ProcessInfo, DIApplicationInfo = di.appInfo, }); }
void OnProcessFound(object sender, ProcessFoundEventArgs e) => ProcessFound?.Invoke(sender, e);