예제 #1
0
        public override object Value(IInternalContextAdapter context)
        {
            int         childrenCount = base.ChildrenCount;
            IDictionary dictionary    = new Hashtable();

            for (int i = 0; i < childrenCount; i += 2)
            {
                SimpleNode simpleNode  = (SimpleNode)base.GetChild(i);
                SimpleNode simpleNode2 = (SimpleNode)base.GetChild(i + 1);
                object     key         = (simpleNode == null) ? null : simpleNode.Value(context);
                object     value       = (simpleNode2 == null) ? null : simpleNode2.Value(context);
                dictionary.Add(key, value);
            }
            return(dictionary);
        }
예제 #2
0
파일: ASTMap.cs 프로젝트: zyj0021/NVelocity
        /// <summary>
        /// Evaluate the node.
        /// </summary>
        public override Object Value(IInternalContextAdapter context)
        {
            int size = ChildrenCount;

            IDictionary objectMap = new Hashtable();

            for (int i = 0; i < size; i += 2)
            {
                SimpleNode keyNode   = (SimpleNode)GetChild(i);
                SimpleNode valueNode = (SimpleNode)GetChild(i + 1);

                Object key   = (keyNode == null ? null : keyNode.Value(context));
                Object value = (valueNode == null ? null : valueNode.Value(context));

                objectMap.Add(key, value);
            }

            return(objectMap);
        }
예제 #3
0
파일: ASTMap.cs 프로젝트: 15831944/tool
        /// <seealso cref="NVelocity.Runtime.Paser.Node.SimpleNode.Value(NVelocity.Context.IInternalContextAdapter)">
        /// </seealso>
        public override object Value(IInternalContextAdapter context)
        {
            int size = GetNumChildren();

            System.Collections.IDictionary objectMap = new System.Collections.Hashtable();

            for (int i = 0; i < size; i += 2)
            {
                SimpleNode keyNode   = (SimpleNode)GetChild(i);
                SimpleNode valueNode = (SimpleNode)GetChild(i + 1);

                object key   = (keyNode == null ? null : keyNode.Value(context));
                object value = (valueNode == null ? null : valueNode.Value(context));

                objectMap[key] = value;
            }

            return(objectMap);
        }