public void Teardown()
        {
            if (_button != null)
            {
                _button.onKeyStateChanged -= OnKeyStateChanged;
                _button.ledFunction        = null;
                _button = null;
            }

            DeleteStoredDataButtonHandler.UnregisterDeleter(this);
        }
        public void Initialize(GlowingButton button)
        {
            _button = button;
            _button.onKeyStateChanged += OnKeyStateChanged;

            _defaultLedFunction = new LedFunctions.LedDelegate(() =>
            {
                return(_button.key || _hasSavedData);
            });

            _button.ledFunction = _defaultLedFunction;

            DeleteStoredDataButtonHandler.RegisterDeleter(this);
        }
Exemplo n.º 3
0
        public void Initialize(GlowingButton button)
        {
            _button = button;
            _button.onKeyStateChanged += OnKeyStateChanged;

            _defaultLedFunction = new LedFunctions.LedDelegate(() =>
            {
                return(_button.key ||
                       (_hasSavedData && ((areObjectsSelected && LedFunctions.LedFlashing.slow.GetLedState(button)) || !areObjectsSelected)));
            });

            _button.ledFunction = _defaultLedFunction;

            DeleteStoredDataButtonHandler.RegisterDeleter(this);
        }
        public void Initialize(GlowingButton button)
        {
            _button = button;
            _button.onKeyStateChanged += OnKeyStateChanged;

            _defaultLedFunction = new LedFunctions.LedDelegate(() =>
            {
                return(_button.key ||
                       (isWindowFocused && LedFunctions.LedFlashing.slow.GetLedState(button)) ||
                       (_hasSavedData && !isWindowFocused));
            });

            _button.ledFunction = _defaultLedFunction;

            DeleteStoredDataButtonHandler.RegisterDeleter(this);

            if (!string.IsNullOrEmpty(_focusedWindowTypeName) && _hasSavedData)
            {
                _focusedWindowType = System.Type.GetType(_focusedWindowTypeName);
            }
        }