protected override void Dispose(bool disposing) { if (!IsDisposed) { if (disposing) { AppConfig.ConfigChanged -= AppConfig_ConfigChanged; SystemEvents.DisplaySettingsChanged -= AppConfig_ConfigChanged; SystemEvents.UserPreferenceChanged -= AppConfig_ConfigChanged; } _penWidth = 0; _bitmap?.Dispose(); _graphicsPath?.Dispose(); _dirtyGraphicsPath?.Dispose(); } base.Dispose(disposing); }
protected override void Dispose(bool disposing) { if (!IsDisposed) { if (disposing) { PointCapture.Instance.PointCaptured -= PointCapture_PointCaptured; PointCapture.Instance.CaptureEnded -= PointCapture_CaptureEnded; PointCapture.Instance.CaptureCanceled -= PointCapture_CaptureCanceled; PointCapture.Instance.CaptureStarted -= Instance_CaptureStarted; AppConfig.ConfigChanged -= AppConfig_ConfigChanged; SystemEvents.DisplaySettingsChanged -= AppConfig_ConfigChanged; SystemEvents.UserPreferenceChanged -= AppConfig_ConfigChanged; } _bitmap?.Dispose(); _graphicsPath?.Dispose(); _dirtyGraphicsPath?.Dispose(); } base.Dispose(disposing); }