protected virtual void Dispose(bool disposing)
        {
            if (dc != null && this.nativeHandle != IntPtr.Zero)
            {
                DbgUtil.AssertFinalization(this, disposing);

                dc.DeleteObject(this.nativeHandle, GdiObjectType.Brush);

                this.nativeHandle = IntPtr.Zero;
            }

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

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

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

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