public void Enqueue(Frame frame, Callback callback) { if (count == queue.Length) { expandQueue(); } queue[count] = new FrameWithHandler { frame = frame, callback = callback }; count++; }
private void expandQueue() { FrameWithHandler[] tmp_queue = new FrameWithHandler[queue.Length * 2]; Array.Copy(queue, tmp_queue, queue.Length); queue = tmp_queue; }