/// <summary> /// Adds the condition with or. /// </summary> /// <param name="condition"> /// The condition. /// </param> /// <returns> /// The <see cref="UPInfoAreaCondition"/>. /// </returns> public UPInfoAreaCondition AddConditionWithOr(UPInfoAreaCondition condition) { this.Condition = this.Condition == null ? condition : this.Condition.InfoAreaConditionByAppendingOrCondition(condition); return(this.Condition); }
/// <summary> /// Informations the area condition by appending or condition. /// </summary> /// <param name="cond"> /// The cond. /// </param> /// <returns> /// The <see cref="UPInfoAreaCondition"/>. /// </returns> public override UPInfoAreaCondition InfoAreaConditionByAppendingOrCondition(UPInfoAreaCondition cond) { if (this.relation == "OR") { this.AddSubCondition(cond); return(this); } return(base.InfoAreaConditionByAppendingOrCondition(cond)); }
/// <summary> /// Replaces the condition with condition. /// </summary> /// <param name="oldCondition"> /// The old condition. /// </param> /// <param name="condition"> /// The condition. /// </param> /// <returns> /// The <see cref="bool"/>. /// </returns> public bool ReplaceConditionWithCondition(UPInfoAreaCondition oldCondition, UPInfoAreaCondition condition) { if (this.conditions.Count == 0) { return(false); } var replaceIndex = this.conditions.IndexOf(oldCondition); if (replaceIndex == -1) { return(false); } this.conditions[replaceIndex] = condition; return(true); }
/// <summary> /// Informations the area condition by appending or condition. /// </summary> /// <param name="cond"> /// The cond. /// </param> /// <returns> /// The <see cref="UPInfoAreaCondition"/>. /// </returns> public virtual UPInfoAreaCondition InfoAreaConditionByAppendingOrCondition(UPInfoAreaCondition cond) => new UPInfoAreaConditionTree("OR", this, cond);
// creates an internal cpp querycondition object // creates an json object for server requests /// <summary> /// Informations the area condition by appending and condition. /// </summary> /// <param name="cond"> /// The cond. /// </param> /// <returns> /// The <see cref="UPInfoAreaCondition"/>. /// </returns> public virtual UPInfoAreaCondition InfoAreaConditionByAppendingAndCondition(UPInfoAreaCondition cond) => new UPInfoAreaConditionTree("AND", this, cond);
/// <summary> /// Initializes a new instance of the <see cref="UPInfoAreaConditionTree"/> class. /// </summary> /// <param name="relation"> /// The relation. /// </param> /// <param name="condition"> /// The condition. /// </param> public UPInfoAreaConditionTree(string relation, UPInfoAreaCondition condition) : this(relation) { this.AddSubCondition(condition); }
// creates an internal cpp querycondition object // creates an json object for server requests /// <summary> /// Initializes a new instance of the <see cref="UPInfoAreaConditionTree"/> class. /// </summary> /// <param name="relation"> /// The relation. /// </param> /// <param name="left"> /// The left. /// </param> /// <param name="right"> /// The right. /// </param> public UPInfoAreaConditionTree(string relation, UPInfoAreaCondition left, UPInfoAreaCondition right) : this(relation) { this.AddSubCondition(left); this.AddSubCondition(right); }
/// <summary> /// Adds the sub condition. /// </summary> /// <param name="condition"> /// The condition. /// </param> public void AddSubCondition(UPInfoAreaCondition condition) { this.conditions.Add(condition); }
/// <summary> /// Sets the condition. /// </summary> /// <param name="condition"> /// The condition. /// </param> public void SetCondition(UPInfoAreaCondition condition) { this.Condition = condition; }