private void Next(params object[] args)
 {
     _list[_index++].OnStop();
     OnElementChanging?.Invoke();
     _list[_index].OnStart(args);
     OnStartWorking?.Invoke();
 }
Esempio n. 2
0
        /// <summary>
        /// Gets or sets matrix element on specified indexes
        /// </summary>
        /// <param name="i">Row index</param>
        /// <param name="j">Column index</param>
        /// <returns>Matrix element on specified index</returns>
        /// <exception cref="ArgumentOutOfRangeException">Thrown when specified indexes is out of range</exception>
        public T this [int i, int j]
        {
            get
            {
                if (i < 0 || j < 0 || i > Size || j > Size)
                {
                    throw new ArgumentOutOfRangeException("Index is out of range.");
                }

                return(matrix[i, j]);
            }

            set
            {
                if (i < 0 || j < 0 || i > Size || j > Size)
                {
                    throw new ArgumentOutOfRangeException("Index is out of range.");
                }

                OnElementChanging?.Invoke(new MatrixEventArgs(i, j));
                matrix[i, j] = value;
            }
        }