/// <summary> /// Safe disposal callback /// </summary> /// <param name="safe">Is Pre-Finailized / Safe (values not cleared by GC)</param> private void Dispose(bool safe) { if (Notifications.IsValidNotification(this)) { Notifications.RemoveNotification(this); } if (safe) { Text = null; TextColor = new ColorBGRA(); BoxColor = new ColorBGRA(); BorderColor = new ColorBGRA(); Font.Dispose(); Font = null; line.Dispose(); sprite.Dispose(); Draw = false; Update = false; duration = 0; if (handler != null) { Notifications.Free(handler); } position = Vector2.Zero; updatePosition = Vector2.Zero; state = 0; decreasementTick = 0; textFix = Vector2.Zero; flashing = false; flashInterval = 0; flashTick = 0; clickTick = 0; border = false; } }
/// <summary> /// Safe disposal callback /// </summary> /// <param name="safe">Is Pre-Finailized / Safe (values not cleared by GC)</param> private void Dispose(bool safe) { if (Notifications.IsValidNotification(this)) { Notifications.RemoveNotification(this); } if (safe) { this.Text = null; this.TextColor = new ColorBGRA(); this.BoxColor = new ColorBGRA(); this.BorderColor = new ColorBGRA(); this.Font.Dispose(); this.Font = null; this.line.Dispose(); this.sprite.Dispose(); this.Draw = false; this.Update = false; this.duration = 0; Notifications.RemoveNotification(this); this.position = Vector2.Zero; this.updatePosition = Vector2.Zero; this.state = 0; this.textFix = Vector2.Zero; this.flashing = false; this.flashInterval = 0; this.flashTick = 0; this.clickTick = 0; this.border = false; } }