Esempio n. 1
0
        private void OnSelectedOperandChanged(GenericOperandEditor <T> source, GenericOperandEditor <T> destination)
        {
            if (_recurseMarker)
            {
                return;
            }

            _recurseMarker = true;
            destination.SelectedOperand = source.SelectedOperand;
            _recurseMarker = false;
        }
Esempio n. 2
0
        public GenericOperandEditorBridge(GenericOperandEditor <T> left, GenericOperandEditor <T> right)
        {
            _left  = left;
            _right = right;

            _leftOnSelectedOperandChanged = (sender, args) => OnSelectedOperandChanged(left, right);
            left.SelectedOperandChanged  += _leftOnSelectedOperandChanged;

            _rightOnSelectedOperandChanged = (sender, args) => OnSelectedOperandChanged(right, left);
            right.SelectedOperandChanged  += _rightOnSelectedOperandChanged;
        }
Esempio n. 3
0
        public void Dispose()
        {
            if (_left != null)
            {
                _left.SelectedOperandChanged -= _leftOnSelectedOperandChanged;
                _left = null;
            }

            if (_right == null)
            {
                return;
            }

            _right.SelectedOperandChanged -= _rightOnSelectedOperandChanged;
            _right = null;
        }