Esempio n. 1
0
 /// <summary>
 /// 获取索引值
 /// </summary>
 /// <param name="name">索引名称</param>
 /// <returns>object</returns>
 public object this[string name]
 {
     get
     {
         VariableElement val = GetElement(name);
         if (val != null)
         {
             return(val.Value);
         }
         return(null);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// 获取结果类型
        /// </summary>
        /// <param name="name">索引名称</param>
        /// <returns>Type</returns>
        public Type GetType(string name)
        {
            VariableElement val = GetElement(name);

            if (val != null)
            {
                if (val.Type != null)
                {
                    return(val.Type);
                }
                if (val.Value != null)
                {
                    return(val.Value.GetType());
                }
            }
            return(null);
        }
Esempio n. 3
0
        /// <inheritdoc />
        public Type GetType(string key)
        {
            VariableElement val = GetElement(key);

            if (val != null)
            {
                if (val.Type != null)
                {
                    return(val.Type);
                }
                if (val.Value != null)
                {
                    return(val.Value.GetType());
                }
            }
            if (Parent != null)
            {
                return(Parent.GetType(key));
            }
            return(null);
        }
Esempio n. 4
0
 /// <inheritdoc />
 public void SetElement(string key, VariableElement element)
 {
     this.dic[key] = element;
 }