コード例 #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);
        }
コード例 #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));
        }
コード例 #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);
        }
コード例 #4
0
 /// <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);
コード例 #5
0
 // 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);
コード例 #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);
 }
コード例 #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);
 }
コード例 #8
0
 /// <summary>
 /// Adds the sub condition.
 /// </summary>
 /// <param name="condition">
 /// The condition.
 /// </param>
 public void AddSubCondition(UPInfoAreaCondition condition)
 {
     this.conditions.Add(condition);
 }
コード例 #9
0
 /// <summary>
 /// Sets the condition.
 /// </summary>
 /// <param name="condition">
 /// The condition.
 /// </param>
 public void SetCondition(UPInfoAreaCondition condition)
 {
     this.Condition = condition;
 }