/// <summary> /// 克隆当前元素到新的宿主模板 /// </summary> /// <param name="ownerTemplate"></param> /// <returns></returns> internal override DMEWeb_Element Clone(DMEWeb_Template ownerTemplate) { DMEWeb_IfConditionTag tag = new DMEWeb_IfConditionTag(ownerTemplate); this.CopyTo(tag); return tag; }
/// <summary> /// /// </summary> /// <param name="tag"></param> protected void CopyTo(DMEWeb_IfConditionTag tag) { base.CopyTo(tag); tag.VarExpression = this.VarExpression == null ? null : (DMEWeb_VariableExpression)(this.VarExpression.Clone(tag.OwnerTemplate)); if (this.Values != null) { foreach (DMEWeb_IExpression exp in this.Values) { tag.Values.Add(exp.Clone(tag.OwnerTemplate)); } } }
/// <summary> /// 添加条件 /// </summary> /// <param name="conditionTag"></param> internal virtual void AddElseCondition(DMEWeb_IfConditionTag conditionTag) { conditionTag.Parent = this; this.ElseIfs.Add(conditionTag); }