示例#1
0
        /// <summary>
        /// Check if the object is containing in the collection
        /// </summary>
        /// <param name="sector"></param>
        /// <returns></returns>
        public bool Contains(LBMeterThreshold sector)
        {
            //loop through the inner ArrayList
            foreach (LBMeterThreshold obj in InnerList)
            {
                //compare the values of the objects
                if ((obj.StartValue == sector.StartValue) &&
                    (obj.EndValue == sector.EndValue))
                {
                    //if it matches return true
                    return(true);
                }
            }

            //no match
            return(false);
        }
示例#2
0
        /// <summary>
        /// Remove an object from the collection
        /// </summary>
        /// <param name="sector"></param>
        /// <returns></returns>
        public virtual bool Remove(LBMeterThreshold sector)
        {
            bool result = false;

            //loop through the inner array's indices
            for (int i = 0; i < InnerList.Count; i++)
            {
                //store current index being checked
                LBMeterThreshold obj = (LBMeterThreshold)InnerList[i];

                //compare the values of the objects
                if ((obj.StartValue == sector.StartValue) &&
                    (obj.EndValue == sector.EndValue))
                {
                    //remove item from inner ArrayList at index i
                    InnerList.RemoveAt(i);
                    result = true;
                    break;
                }
            }

            return(result);
        }
示例#3
0
 /// <summary>
 /// Add an object to the collection
 /// </summary>
 /// <param name="sector"></param>
 public virtual void Add(LBMeterThreshold sector)
 {
     InnerList.Add(sector);
 }
示例#4
0
        /// <summary>
        /// Remove an object from the collection
        /// </summary>
        /// <param name="sector"></param>
        /// <returns></returns>
        public virtual bool Remove(LBMeterThreshold sector)
        {
            bool result = false;

            //loop through the inner array's indices
            for (int i = 0; i < InnerList.Count; i++)
            {
                //store current index being checked
                LBMeterThreshold obj = (LBMeterThreshold)InnerList[i];

                //compare the values of the objects
                if ((obj.StartValue == sector.StartValue) &&
                    (obj.EndValue == sector.EndValue))
                {
                    //remove item from inner ArrayList at index i
                    InnerList.RemoveAt(i);
                    result = true;
                    break;
                }
            }

            return result;
        }
示例#5
0
 /// <summary>
 /// Copy the collection
 /// </summary>
 /// <param name="LBAnalogMeterSectorArray"></param>
 /// <param name="index"></param>
 public virtual void CopyTo(LBMeterThreshold[] MeterThresholdArray, int index)
 {
     throw new Exception("This Method is not valid for this implementation.");
 }
示例#6
0
        /// <summary>
        /// Check if the object is containing in the collection
        /// </summary>
        /// <param name="sector"></param>
        /// <returns></returns>
        public bool Contains(LBMeterThreshold sector)
        {
            //loop through the inner ArrayList
            foreach (LBMeterThreshold obj in InnerList)
            {
                //compare the values of the objects
                if ((obj.StartValue == sector.StartValue) &&
                    (obj.EndValue == sector.EndValue))
                {
                    //if it matches return true
                    return true;
                }
            }

            //no match
            return false;
        }
示例#7
0
 /// <summary>
 /// Add an object to the collection
 /// </summary>
 /// <param name="sector"></param>
 public virtual void Add(LBMeterThreshold sector)
 {
     InnerList.Add(sector);
 }