Esempio n. 1
0
 /// <summary>
 ///   removes expression handlers for the specific task
 ///   it is needed for destination call for exit from the previous subform
 /// </summary>
 /// <param name = "task"></param>
 internal void removeExpressionHandler(Task task)
 {
     for (int i = 0; i < _expHandlers.getSize();)
     {
         Task timerTask = _expHandlers.getHandler(i).getTask();
         if (timerTask.isDescendentOf(task) && timerTask.getMGData() == this)
         {
             _expHandlers.remove(i);
         }
         else
         {
             i++;
         }
     }
 }
Esempio n. 2
0
        /// <summary>
        ///   returns the next event handler
        /// </summary>
        internal EventHandler getNext()
        {
            EventHandler handler;

            if (_handlersTab == null)
            {
                return(null);
            }

            if (_rtEvt.getType() == ConstInterface.EVENT_TYPE_INTERNAL &&
                _rtEvt.getInternalCode() != InternalInterface.MG_ACT_VARIABLE)
            {
                // special treatment for TASK, RECORD and CONTROL level Prefix/Suffix events
                switch (_rtEvt.getInternalCode())
                {
                case InternalInterface.MG_ACT_TASK_PREFIX:
                case InternalInterface.MG_ACT_TASK_SUFFIX:
                case InternalInterface.MG_ACT_REC_PREFIX:
                case InternalInterface.MG_ACT_REC_SUFFIX:
                case InternalInterface.MG_ACT_CTRL_PREFIX:
                case InternalInterface.MG_ACT_CTRL_SUFFIX:
                case InternalInterface.MG_ACT_CTRL_VERIFICATION:

                    if (_handlerIdx == -1)
                    {
                        for (_handlerIdx = _handlersTab.getSize() - 1; _handlerIdx >= 0; _handlerIdx--)
                        {
                            handler = _handlersTab.getHandler(_handlerIdx);
                            if (handler.isNonSpecificHandlerOf(_rtEvt) || handler.isSpecificHandlerOf(_rtEvt))
                            {
                                return(handler);
                            }
                        }
                    }
                    // an event handler was not found or was returned in a previous call to this method
                    return(null);

                default:
                    // other internal events should continue
                    break;
                }
            }

            while (setNextHandlerIdx())
            {
                handler = _handlersTab.getHandler(_handlerIdx);
                switch (_phase)
                {
                case PHASE_CONTROL_SPECIFIC:
                    if (handler.isSpecificHandlerOf(_rtEvt))
                    {
                        return(handler);
                    }
                    continue;

                case PHASE_CONTROL_NON_SPECIFIC:
                    if (handler.isNonSpecificHandlerOf(_rtEvt))
                    {
                        return(handler);
                    }
                    continue;

                case PHASE_GLOBAL_SPECIFIC:
                    if (handler.isGlobalSpecificHandlerOf(_rtEvt))
                    {
                        return(handler);
                    }
                    continue;

                case PHASE_GLOBAL:
                    if (handler.isGlobalHandlerOf(_rtEvt))
                    {
                        return(handler);
                    }
                    continue;

                default:
                    Logger.Instance.WriteExceptionToLog("in EventHandlerPosition.getNext() invalid phase: " + _phase);
                    break;
                }
            }
            return(null);
        }