Exemplo n.º 1
0
        /// <summary> restore the previous parsing information from the history stack</summary>
        public void pop()
        {
            int size = _history.Count;

            _xmLdata   = ((String)_history[size - 1]);
            _currIndex = ((Int32)_history[size - 2]);

            _history.SetSize(size - 2);
        }
Exemplo n.º 2
0
 /// <summary>
 ///   set task of event
 /// </summary>
 /// <param name = "task"></param>
 /// <param name = "index"> </param>
 internal void setTaskAt(Task task, int index)
 {
     // ensure that the vector size is sufficient
     if (_tasks.Count <= index)
     {
         _tasks.SetSize(index + 1);
     }
     _tasks[index] = task;
 }
Exemplo n.º 3
0
 /// <summary>set a control to a cell in the table</summary>
 /// <param name = "ctrl">is the control to be added</param>
 /// <param name = "index">where to set the control</param>
 public void setControlAt(MgControlBase ctrl, int index)
 {
     // ensure that the vector size is sufficient
     if (_controls.Count <= index)
     {
         _controls.SetSize(index + 1);
     }
     _controls[index] = ctrl;
 }
Exemplo n.º 4
0
        /// <summary>
        ///   add all commands which are not attached to any window into the current window
        /// </summary>
        internal void copyUnframedCmds()
        {
            MgArrayList unframedCmds = ClientManager.Instance.getUnframedCmds();

            for (int i = 0; i < unframedCmds.Count; i++)
            {
                CmdsToClient.Add((IClientCommand)unframedCmds[i]);
            }

            unframedCmds.SetSize(0);
        }
Exemplo n.º 5
0
        /// <summary>
        ///   Execute all commands in command table and delete them
        /// </summary>
        /// <param name="res">result.</param>
        protected internal void Execute(IResultValue res)
        {
            IClientTargetedCommand cmd;
            int i, j;
            int currFrame = ClientManager.Instance.getCmdFrame(); //cmdFrame++;  save a local value of the frame

            ClientManager.Instance.add1toCmdFrame();
            int firstBlocking = -1;

            // frames are used here to make sure that when this method is called recursively
            // the inner call will not execute commands that should be executed by some outer
            // call to the method

            // First step - move all result commands before any blocking commands (QCR #693428)
            // it can't be that they belong to the blocking task.
            for (i = 0; i < getSize(); i++)
            {
                cmd = getCmd(i) as IClientTargetedCommand;

                if (cmd.IsBlocking && firstBlocking == -1)
                {
                    firstBlocking = i;
                }
                else if (cmd is ResultCommand && firstBlocking != -1)
                {
                    _cmds.Insert(firstBlocking, cmd);
                    _cmds.RemoveAt(i + 1);
                }
            }

            // set the frame for commands which has no frame yet
            for (i = 0; i < getSize(); i++)
            {
                cmd       = getCmd(i) as IClientTargetedCommand;
                cmd.Frame = currFrame;

                // If a command blocks the caller, following commands are moved to
                // the next active MGdata, so they will be executed (QCR #438387)
                if (cmd.IsBlocking)
                {
                    for (j = i + 1; j < getSize(); j++)
                    {
                        ClientManager.Instance.addUnframedCmd(getCmd(j));
                    }
                    _cmds.SetSize(i + 1);
                    break;
                }
            }

            while (getSize() > 0)
            {
                cmd = extractCmd(currFrame) as IClientTargetedCommand;
                if (cmd != null)
                {
                    if (cmd.ShouldExecute)
                    {
                        cmd.Execute(res);
                    }
                    else
                    {
                        ClientManager.Instance.addCommandsExecutedAfterTaskStarted(cmd);
                    }
                }
                else
                {
                    break;
                }
            }
        }