/// <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); }
/// <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); }
/// <summary> /// Add an object to the collection /// </summary> /// <param name="sector"></param> public virtual void Add(LBMeterThreshold sector) { InnerList.Add(sector); }
/// <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; }
/// <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."); }
/// <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; }