コード例 #1
0
        public int IndexOf(ViewClockTimeObserver element)
        {
            ViewClockTimeObserver[] array = this.Array;
            int length = this.Length;

            for (int i = 0; i < length; i++)
            {
                if (array[i].Equals(element))
                {
                    return(i);
                }
            }
            return(-1);
        }
コード例 #2
0
        public void Add(ViewClockTimeObserver element)
        {
            ViewClockTimeObserver[] array = this.Array;
            int length   = this.Length;
            int capacity = this.Capacity;

            if (length == capacity)
            {
                int num = capacity * 2;
                ViewClockTimeObserver[] array2 = new ViewClockTimeObserver[num];
                for (int i = 0; i < length; i++)
                {
                    array2[i] = array[i];
                }
                this.Array    = array2;
                this.Capacity = num;
                array         = array2;
            }
            array[length] = element;
            this.Length++;
        }
コード例 #3
0
        public void Insert(int index, ViewClockTimeObserver element)
        {
            ViewClockTimeObserver[] array = this.Array;
            int length   = this.Length;
            int capacity = this.Capacity;

            if (length == capacity)
            {
                int num = capacity * 2;
                ViewClockTimeObserver[] array2 = new ViewClockTimeObserver[num];
                for (int i = 0; i < length; i++)
                {
                    array2[i] = array[i];
                }
                this.Array    = array2;
                this.Capacity = num;
                array         = array2;
            }
            if (index == length)
            {
                array[length] = element;
                this.Length++;
            }
            else
            {
                ViewClockTimeObserver viewClockTimeObserver = array[index];
                array[index] = element;
                for (int j = index + 1; j < length; j++)
                {
                    ViewClockTimeObserver viewClockTimeObserver2 = array[j];
                    array[j] = viewClockTimeObserver;
                    viewClockTimeObserver = viewClockTimeObserver2;
                }
                array[length] = viewClockTimeObserver;
                this.Length++;
            }
        }