public override object GetValue(FunctionContextContainer contextContainer)
        {
            if (contextContainer == null)
            {
                throw new ArgumentNullException("contextContainer");
            }

            Initialize();

            return(_functionFunctionRuntimeNode.GetValue(contextContainer));
        }
Example #2
0
        /// <exclude />
        public override object GetValue(FunctionContextContainer contextContainer)
        {
            Verify.ArgumentNotNull(contextContainer, "contextContainer");

            return(_functionNode.GetValue(contextContainer));
        }
Example #3
0
        /// <summary>
        /// Executes the function. Note that all the XhtmlParameters will have all the nested &gt;f:function /&lt; lazily evaluated
        /// </summary>
        private static object ExecuteFunction(IFunction function, IDictionary<string, object> parameters, FunctionContextContainer functionContextContainer )
        {
            List<BaseParameterRuntimeTreeNode> parameterNodes = new List<BaseParameterRuntimeTreeNode>();

            if (parameters != null)
            {
                foreach (KeyValuePair<string, object> kvp in parameters)
                {
                    var value = kvp.Value;
                    if (value is XhtmlDocument)
                    {
                        parameterNodes.Add(new LazyParameterRuntimeTreeNode(kvp.Key,
                            () => ExecuteNestedFunctions(value as XhtmlDocument, functionContextContainer)));
                    }
                    else
                    {
                        parameterNodes.Add(new ConstantObjectParameterRuntimeTreeNode(kvp.Key, kvp.Value));
                    }
                }
            }

            var treeNode = new FunctionRuntimeTreeNode(function, parameterNodes);

            return treeNode.GetValue(functionContextContainer);
        }