示例#1
0
        /// <summary>
        /// Gets the list of children which this object contains.  The children can be either
        /// members (x.fob, x.oar) or they can be indexes (x[0], x[1], etc...).  Calling this
        /// causes the children to be determined by communicating with the debuggee.  These
        /// objects can then later be evaluated.  The names returned here are in the form of
        /// "fob" or "0" so they need additional work to append onto this expression.
        ///
        /// Returns null if the object is not expandable.
        /// </summary>
        public PythonEvaluationResult[] GetChildren(int timeOut)
        {
            if (!IsExpandable)
            {
                return(null);
            }

            AutoResetEvent childrenEnumed = new AutoResetEvent(false);

            PythonEvaluationResult[] res = null;

            _process.EnumChildren(Expression, _frame, (children) => {
                res = children;
                childrenEnumed.Set();
            });

            while (!_frame.Thread.Process.HasExited && !childrenEnumed.WaitOne(Math.Min(timeOut, 100)))
            {
                if (timeOut <= 100)
                {
                    break;
                }
                timeOut -= 100;
            }

            return(res);
        }