Example #1
0
        void Dispose(bool disposing)
        {
            if (!_nativeHandle.IsNull && _dc != null)
            {
                _dc.DeleteObject(_nativeHandle, GdiObjectType.Pen);
                _nativeHandle = default;
            }

            if (_wndBrush != null)
            {
                _wndBrush.Dispose();
                _wndBrush = null;
            }

            if (disposing)
            {
                GC.SuppressFinalize(this);
            }
        }
Example #2
0
        void Dispose(bool disposing)
        {
            if (_nativeHandle != IntPtr.Zero && _dc != null)
            {
                _dc.DeleteObject(_nativeHandle, GdiObjectType.Pen);
                _nativeHandle = IntPtr.Zero;
            }

            if (_wndBrush != null)
            {
                _wndBrush.Dispose();
                _wndBrush = null;
            }

            if (disposing)
            {
                GC.SuppressFinalize(this);
            }
        }
Example #3
0
        void Dispose(bool disposing)
        {
            if (nativeHandle != IntPtr.Zero && dc != null)
            {
                DbgUtil.AssertFinalization(this, disposing);

                dc.DeleteObject(nativeHandle, GdiObjectType.Pen);
                nativeHandle = IntPtr.Zero;
            }

            if (wndBrush != null)
            {
                wndBrush.Dispose();
                wndBrush = null;
            }

            if (disposing)
            {
                GC.SuppressFinalize(this);
            }
        }