示例#1
0
        protected override void Dispose(bool disposing)
        {
            if (_isDisposed)
            {
                return;
            }

            _isDisposed = true;

            if (disposing)
            {
                if (Control != null)
                {
                    Control.SetOnClickListener(null);
                    Control.SetOnTouchListener(null);
                    Control.RemoveOnAttachStateChangeListener(this);
                    _textColorSwitcher = null;
                }
                _backgroundTracker?.Dispose();
                _backgroundTracker = null;
                _buttonLayoutManager?.Dispose();
                _buttonLayoutManager = null;
            }

            base.Dispose(disposing);
        }
示例#2
0
        protected override void Dispose(bool disposing)
        {
            if (_isDisposed)
            {
                return;
            }

            if (Control != null)
            {
                Control.TouchUpInside -= OnButtonTouchUpInside;
                Control.TouchDown     -= OnButtonTouchDown;
                _buttonLayoutManager?.Dispose();
                _buttonLayoutManager = null;
            }

            _isDisposed = true;

            base.Dispose(disposing);
        }