public override void Dispose() { if (IsDisposed) { return; } if (ImpactTimer != null) { ImpactTimer.Stop(); ImpactTimer = null; } base.Dispose(); Target = null; }
protected override void OnAfterSend() { if (IsDisposed) { return; } var delay = GetTravelTime(); if (delay > TimeSpan.Zero) { ImpactTimer = Timer.DelayCall( delay, () => { if (ImpactTimer != null) { ImpactTimer.Stop(); ImpactTimer = null; } if (IsDisposed) { return; } if (ImpactCallback != null) { ImpactCallback.Invoke(); ImpactCallback = null; } base.OnAfterSend(); }); } else { if (ImpactCallback != null) { ImpactCallback.Invoke(); ImpactCallback = null; } base.OnAfterSend(); } }