/// <summary> /// 克隆当前元素到新的宿主模板 /// </summary> /// <param name="ownerTemplate"></param> /// <returns></returns> internal override Element Clone(Template ownerTemplate) { IfConditionTag tag = new IfConditionTag(ownerTemplate); this.CopyTo(tag); return(tag); }
/// <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)); } } }
/// <summary> /// 添加条件 /// </summary> /// <param name="conditionTag"></param> internal virtual void AddElseCondition(IfConditionTag conditionTag) { conditionTag.Parent = this; this.ElseIfs.Add(conditionTag); }
/// <summary> /// 克隆当前元素到新的宿主模板 /// </summary> /// <param name="ownerTemplate"></param> /// <returns></returns> internal override Element Clone(Template ownerTemplate) { IfConditionTag tag = new IfConditionTag(ownerTemplate); this.CopyTo(tag); return tag; }