Example #1
0
        /* Override this method if you want to customize how the node dumps
         * out its children. */

        public void dump(TextWriter writer, string prefix)
        {
            writer.WriteLine(ToString(prefix));
            if (children != null)
            {
                for (int i = 0; i < children.Length; ++i)
                {
                    SimpleNode n = (SimpleNode)children[i];
                    if (n != null)
                    {
                        n.dump(writer, prefix + "  ");
                    }
                }
            }
        }
Example #2
0
        ///
        /// Returns an Evaluation that contains the node, source and whether it
        /// is a set operation.  If there are no Evaluation objects in the
        /// pool one is created and returned.
        ///
        public Evaluation create(SimpleNode node, object source, bool setOperation)
        {
            lock (this)
            {
                Evaluation result;

                if (size > 0)
                {
                    result = (Evaluation)evaluations [size - 1];
                    evaluations.RemoveAt(size - 1);
                    result.init(node, source, setOperation);
                    size--;
                    recovered++;
                }
                else
                {
                    result = new Evaluation(node, source, setOperation);
                    created++;
                }
                return(result);
            }
        }
Example #3
0
 ///<summary>
 /// Sets the node of the evaluation.  Normally applications do not need to
 /// set this.  Notable exceptions to this rule are custom evaluators that
 /// choose between navigable objects (as in a multi-root evaluator where
 /// the navigable node is chosen at runtime).
 ///</summary>
 public void setNode(SimpleNode value)
 {
     node = value;
 }
Example #4
0
 ///<summary>
 /// Constructs a new <code>Evaluation</code> from the node and source given.
 /// If <code>setOperation</code> is true this <code>Evaluation</code> represents
 /// a "set" as opposed to a "get".
 /// </summary>
 public Evaluation(SimpleNode node, object source, bool setOperation) : this(node, source)
 {
     this.setOperation = setOperation;
 }
Example #5
0
 /// <summary>
 /// Constructs a new "get" <code>Evaluation</code> from the node and source given.
 ///</summary>
 public Evaluation(SimpleNode node, object source)
 {
     this.node   = node;
     this.source = source;
 }
Example #6
0
 ///
 /// Returns an Evaluation that contains the node, source and whether it
 /// is a set operation.  If there are no Evaluation objects in the
 /// pool one is created and returned.
 ///
 public Evaluation create(SimpleNode node, object source)
 {
     return(create(node, source, false));
 }