Beispiel #1
0
        /// <summary>
        /// 添加标签属性时的触发函数.用于设置自身的某些属性值
        /// </summary>
        /// <param name="name"></param>
        /// <param name="item"></param>
        protected override void OnAddingAttribute(string name, Attribute item)
        {
            switch (name)
            {
            case "args":
                IExpression exp = item.Value;
                if (this.OwnerDocument.DocumentConfig.CompatibleMode)
                {
                    if (!(exp is VariableExpression))
                    {
                        exp = ParserHelper.CreateVariableExpression(this.OwnerTemplate, item.Text, false);
                    }
                }
                this.ExpArgs.Add(exp);
                break;

            case "var":
                this.Variable = ParserHelper.CreateVariableIdentity(this.OwnerTemplate, item.Text);
                break;

            case "output":
                this.Output = Utility.ConverToBoolean(item.Text);
                break;
            }
        }
Beispiel #2
0
        /// <summary>
        /// 添加标签属性时的触发函数.用于设置自身的某些属性值
        /// </summary>
        /// <param name="name"></param>
        /// <param name="item"></param>
        protected override void OnAddingAttribute(string name, Attribute item)
        {
            switch (name)
            {
            case "var":
                this.VarExpression = ParserHelper.CreateVariableExpression(this.OwnerTemplate, item.Text, false);
                break;

            case "value":
                this.Values.Add(item.Value);
                break;
            }
        }
Beispiel #3
0
        /// <summary>
        /// 添加标签属性时的触发函数.用于设置自身的某些属性值
        /// </summary>
        /// <param name="name"></param>
        /// <param name="item"></param>
        public override void OnAddingAttribute(string name, Attribute item)
        {
            switch (name)
            {
            case "from":
                VariableExpression ve = item.Value as VariableExpression;
                if (ve == null && this.OwnerDocument.DocumentConfig.CompatibleMode)
                {
                    ve = ParserHelper.CreateVariableExpression(this.OwnerTemplate, item.Text, false);
                }
                this.From = ve;
                break;

            case "item":
                this.Item = ParserHelper.CreateVariableIdentity(this.OwnerTemplate, item.Text);
                break;

            case "index":
                this.Index = ParserHelper.CreateVariableIdentity(this.OwnerTemplate, item.Text);
                break;
            }
        }