Ejemplo n.º 1
0
        /// <summary>
        /// Adds a new source rectagle to the back of the timeline
        /// </summary>
        /// <param name="r"></param>
        public void AddSourceRectangle(Rectangle r)
        {
            //Check if out array has yet to be filled
            if (_sourcerectangles[0] == new Rectangle(0, 0, 0, 0) && _sourcerectangles.Count() == 1)
            {
                _sourcerectangles[0] = r;
                return;
            }

            int upper = _sourcerectangles.GetUpperBound(0);
            var copy = new Rectangle[upper + 2];

            for (int i = 0; i <= upper; i++)
            {
                copy[i] = _sourcerectangles[i];
            }
            copy[copy.GetUpperBound(0)] = r;

            //Copy over the new array
            _sourcerectangles = (Rectangle[])copy.Clone();
        }