CheckWidgetEnabled() public method

Sets the states of the buttons in the button bar and in the companion scanner (if any) depending on the current state.
public CheckWidgetEnabled ( ACAT.Lib.Core.AgentManagement.CheckEnabledArgs arg ) : bool
arg ACAT.Lib.Core.AgentManagement.CheckEnabledArgs widget information
return bool
Example #1
0
        /// <summary>
        /// Invoked to check if a scanner button should be enabled.  Uses context
        /// to determine the 'enabled' state.
        /// </summary>
        /// <param name="arg">info about the scanner button</param>
        public override void CheckWidgetEnabled(CheckEnabledArgs arg)
        {
            arg.Handled = true;

            switch (arg.Widget.SubClass)
            {
            case "PunctuationScanner":
            case "NumberScanner":
                arg.Enabled = true;
                break;

            default:
                if (_launchAppScanner != null)
                {
                    _launchAppScanner.CheckWidgetEnabled(arg);
                }
                if (!arg.Handled)
                {
                    arg.Enabled = false;
                    arg.Handled = true;
                }
                break;
            }
        }