private async void Connection_OnApplicationDidTerminate(object sender, BarRaider.SdTools.Wrappers.SDEventReceivedEventArgs <BarRaider.SdTools.Events.ApplicationDidTerminate> e) { if (e.Event.Payload.Application != "League of Legends.exe") { return; } _isInGame = false; _info.ClearGameData(); _cts.Cancel(); _cts = new CancellationTokenSource(); switch (_settings.DisplayFormat) { case EBuyItemDisplayFormat.RemainingCost: await Connection.SetTitleAsync(string.Empty); break; case EBuyItemDisplayFormat.None: case EBuyItemDisplayFormat.TotalCost: break; default: throw new ArgumentOutOfRangeException(nameof(_settings.DisplayFormat)); } UpdateItemImage(_settings.ItemId); }
private async void Connection_OnApplicationDidTerminate(object sender, BarRaider.SdTools.Wrappers.SDEventReceivedEventArgs <BarRaider.SdTools.Events.ApplicationDidTerminate> e) { if (e.Event.Payload.Application != "League of Legends.exe") { return; } _isInGame = false; await ResetTimer(); _info.ClearGameData(); _cts.Cancel(); _cts = new CancellationTokenSource(); await Connection.SetDefaultImageAsync(); }