public detectionObject getElement() { if (detectionList.Count > 0) { detectionObject tmp = detectionList[detectionList.Count - 1]; detectionList.RemoveAt(detectionList.Count - 1); return(tmp); } else { throw new AccessViolationException(); } }
public int AddElement(detectionObject obj) { try { this.detectionList.Add(obj); //First in first out if (detectionList.Count > 10) { detectionList.RemoveAt(0); } }catch (Exception e) { return(-1); } return(1); }