Exemple #1
0
        /// <summary>
        /// Checks if a widget should be enabled or disabled. This
        /// depends on the context.  This function is invoked for
        /// each widget on the scanner, periodically.
        /// The call is forwarded to the active agent which actually handles
        /// it as it is the one that is intimately aware of the context
        /// </summary>
        /// <param name="arg">widget info</param>
        public void CheckWidgetEnabled(CheckEnabledArgs arg)
        {
            if (_currentAgent != null)
            {
                if (_currentAgent is IFunctionalAgent &&
                    ((FunctionalAgentBase)_currentAgent).IsClosing)
                {
                    Log.Debug("Functional agent is closing. returning");
                    return;
                }

                _currentAgent.CheckWidgetEnabled(arg);
                if (!arg.Handled && _currentAgent.TextControlAgent != null)
                {
                    _currentAgent.TextControlAgent.CheckWidgetEnabled(arg);
                }
            }
        }