/// <summary> /// Check if the object is containing in the collection /// </summary> /// <param name="sector">The sector.</param> /// <returns><c>true</c> if [contains] [the specified sector]; otherwise, <c>false</c>.</returns> public bool Contains(ZeroitLBMeterThreshold sector) { //loop through the inner ArrayList foreach (ZeroitLBMeterThreshold 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); }
/// <summary> /// Remove an object from the collection /// </summary> /// <param name="sector">The sector.</param> /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns> public virtual bool Remove(ZeroitLBMeterThreshold sector) { bool result = false; //loop through the inner array's indices for (int i = 0; i < InnerList.Count; i++) { //store current index being checked ZeroitLBMeterThreshold obj = (ZeroitLBMeterThreshold)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); }
/// <summary> /// Add an object to the collection /// </summary> /// <param name="sector">The sector.</param> public virtual void Add(ZeroitLBMeterThreshold sector) { InnerList.Add(sector); }