public void insert(EventScript obj) { //percolate up load++; eventArray.Add(obj); int hole = load; //number of elements in heap for (; hole > 1 && obj.CompareTo(eventArray[hole / 2]) < 0; hole /= 2) { eventArray[hole] = eventArray[hole / 2]; } eventArray[hole] = obj; }