Example #1
0
        /// <summary>
        /// Walks the object graph rooted in this node.
        /// </summary>
        /// <param name="callback">The callback method.</param>
        /// <param name="context">Current <see cref="ScriptContext"/>.</param>
        public void Walk(PhpWalkCallback callback, ScriptContext context)
        {
            IPhpObjectGraphNode node = value as IPhpObjectGraphNode;

            if (node != null)
            {
                value = callback(node, context);
                node  = value as IPhpObjectGraphNode;

                if (node != null)
                {
                    node.Walk(callback, context);
                }
            }
        }
Example #2
0
 /// <summary>
 /// Walks the object graph rooted in this node.
 /// </summary>
 /// <param name="callback">The callback method.</param>
 /// <param name="context">Current <see cref="ScriptContext"/>.</param>
 public void Walk(PhpWalkCallback callback, ScriptContext context)
 {
     // PhpResources have no child objects, however as they constitute an interesting PHP type,
     // IPhpObjectGraphNode is implemented
 }
Example #3
0
		/// <summary>
		/// Walks the object graph rooted in this node.
		/// </summary>
		/// <param name="callback">The callback method.</param>
		/// <param name="context">Current <see cref="ScriptContext"/>.</param>
		public void Walk(PhpWalkCallback callback, ScriptContext context)
		{
			// PhpResources have no child objects, however as they constitute an interesting PHP type,
			// IPhpObjectGraphNode is implemented
		}
Example #4
0
 /// <summary>
 /// Walks the object graph using specified callback function.
 /// </summary>
 /// <param name="context"></param>
 /// <param name="callback"></param>
 /// <param name="node">Object graph, can be null.</param>
 public static void TransformParameterGraph(ScriptContext context, PhpWalkCallback callback, IPhpObjectGraphNode node)
 {
     if (node != null) node.Walk(callback, context);
 }