Exemplo n.º 1
0
        private bool ForEachConstraintRecursively(IFunction4 block)
        {
            IQueue4     queue      = new NoDuplicatesQueue(new NonblockingQueue());
            IEnumerator constrIter = IterateConstraints();

            while (constrIter.MoveNext())
            {
                queue.Add(constrIter.Current);
            }
            while (queue.HasNext())
            {
                QCon constr = (QCon)queue.Next();
                bool cancel = (bool)block.Apply(constr);
                if (cancel)
                {
                    return(true);
                }
                IEnumerator childIter = constr.IterateChildren();
                while (childIter.MoveNext())
                {
                    queue.Add(childIter.Current);
                }
                IEnumerator joinIter = constr.IterateJoins();
                while (joinIter.MoveNext())
                {
                    queue.Add(joinIter.Current);
                }
            }
            return(false);
        }
		private bool HasJoins(QCon con)
		{
			if (con.HasJoins())
			{
				return true;
			}
			IEnumerator childIter = con.IterateChildren();
			while (childIter.MoveNext())
			{
				if (HasJoins((QCon)childIter.Current))
				{
					return true;
				}
			}
			return false;
		}