public void RemoveHoverEvents() { foreach (Delegate d in OnCoinHover.GetInvocationList()) { OnCoinHover -= (EventHandler)d; } }
/// <summary> /// Sets the autoremove with specified timeframe. /// </summary> /// <param name="v"></param> public async void SetAutoRemove(int v) { try { await Task.Delay(v, CurrencyPickupCancellationSource.Token); OnCoinHover?.Invoke(this, null); } catch (TaskCanceledException) { CurrencyPickupCancellationSource = new CancellationTokenSource(); } catch (Exception) { //ok, dikke error throw; // smijt weg dat ding } }
public void Hovered() { CurrencyPickupCancellationSource.Cancel(); OnCoinHover?.Invoke(this, null); }