public override T this[int i, int j] { get { if (IndexesValidation(i, j)) { if (i == j) { return(InnerMatrix[i]); } return(InnerMatrix[i + RowsAndColsNumber - 1 + j]); } throw new ArgumentException("get error"); } set { var previousValue = this[i, j]; //IndexesValidation var e = new MatrixEventArgs <T>(i, j, previousValue, value); if (i == j) { InnerMatrix[i] = value; } else { InnerMatrix[i + RowsAndColsNumber - 1 + j] = value; } //InnerMatrix[i * RowsAndColsNumber + j] = value; OnMatrixEvent(e); } }
/// <summary> /// Event Invoker. /// </summary> /// <param name="e"> Arguments of event</param> protected virtual void OnMatrixEvent(MatrixEventArgs<T> e) { MatrixEvent?.Invoke(this, e); }