Exemple #1
0
        /// <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);
        }
Exemple #2
0
        /// <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));
        }
Exemple #3
0
        /// <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);
Exemple #6
0
 /// <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);
 }
Exemple #7
0
 // 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);
 }
Exemple #8
0
 /// <summary>
 /// Adds the sub condition.
 /// </summary>
 /// <param name="condition">
 /// The condition.
 /// </param>
 public void AddSubCondition(UPInfoAreaCondition condition)
 {
     this.conditions.Add(condition);
 }
Exemple #9
0
 /// <summary>
 /// Sets the condition.
 /// </summary>
 /// <param name="condition">
 /// The condition.
 /// </param>
 public void SetCondition(UPInfoAreaCondition condition)
 {
     this.Condition = condition;
 }