コード例 #1
0
        protected virtual void Dispose(bool disposing)
        {
            if (DC != null && !_nativeHandle.IsNull)
            {
                DC.DeleteObject(_nativeHandle, GdiObjectType.Brush);
                _nativeHandle = default;
            }

            if (disposing)
            {
                GC.SuppressFinalize(this);
            }
        }
コード例 #2
0
        protected virtual void Dispose(bool disposing)
        {
            if (DC != null && _nativeHandle != IntPtr.Zero)
            {
                DC.DeleteObject(_nativeHandle, GdiObjectType.Brush);

                _nativeHandle = IntPtr.Zero;
            }

            if (disposing)
            {
                GC.SuppressFinalize(this);
            }
        }
コード例 #3
0
ファイル: WindowsBrush.cs プロジェクト: waqashaneef/winforms
        protected virtual void Dispose(bool disposing)
        {
            if (dc != null && nativeHandle != IntPtr.Zero)
            {
                DbgUtil.AssertFinalization(this, disposing);

                dc.DeleteObject(nativeHandle, GdiObjectType.Brush);

                nativeHandle = IntPtr.Zero;
            }

            if (disposing)
            {
                GC.SuppressFinalize(this);
            }
        }
コード例 #4
0
ファイル: WindowsPen.cs プロジェクト: zhouyicheng21/winforms
        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);
            }
        }
コード例 #5
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);
            }
        }
コード例 #6
0
ファイル: WindowsPen.cs プロジェクト: waqashaneef/winforms
        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);
            }
        }