示例#1
0
        /// <summary>
        /// 克隆当前元素到新的宿主模板
        /// </summary>
        /// <param name="ownerTemplate"></param>
        /// <returns></returns>
        internal override Element Clone(Template ownerTemplate)
        {
            IfConditionTag tag = new IfConditionTag(ownerTemplate);

            this.CopyTo(tag);
            return(tag);
        }
示例#2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="tag"></param>
 protected void CopyTo(IfConditionTag tag)
 {
     base.CopyTo(tag);
     tag.VarExpression = this.VarExpression == null ? null : (VariableExpression)(this.VarExpression.Clone(tag.OwnerTemplate));
     if (this.Values != null)
     {
         foreach (IExpression exp in this.Values)
         {
             tag.Values.Add(exp.Clone(tag.OwnerTemplate));
         }
     }
 }
示例#3
0
 /// <summary>
 /// 添加条件
 /// </summary>
 /// <param name="conditionTag"></param>
 internal virtual void AddElseCondition(IfConditionTag conditionTag)
 {
     conditionTag.Parent = this;
     this.ElseIfs.Add(conditionTag);
 }
示例#4
0
 /// <summary>
 /// 添加条件
 /// </summary>
 /// <param name="conditionTag"></param>
 internal virtual void AddElseCondition(IfConditionTag conditionTag)
 {
     conditionTag.Parent = this;
     this.ElseIfs.Add(conditionTag);
 }
示例#5
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="tag"></param>
 protected void CopyTo(IfConditionTag tag)
 {
     base.CopyTo(tag);
     tag.VarExpression = this.VarExpression == null ? null : (VariableExpression)(this.VarExpression.Clone(tag.OwnerTemplate));
     if (this.Values != null)
     {
         foreach (IExpression exp in this.Values)
         {
             tag.Values.Add(exp.Clone(tag.OwnerTemplate));
         }
     }
 }
示例#6
0
 /// <summary>
 /// 克隆当前元素到新的宿主模板
 /// </summary>
 /// <param name="ownerTemplate"></param>
 /// <returns></returns>
 internal override Element Clone(Template ownerTemplate)
 {
     IfConditionTag tag = new IfConditionTag(ownerTemplate);
     this.CopyTo(tag);
     return tag;
 }