/// <summary> /// Change element in matrix /// </summary> /// <param name="row">row of matrix</param> /// <param name="column">column of matrix</param> /// <param name="element">element which is replaced with element[row,column]</param> public void ChangeElement(int row, int column, T element) { MatrixEventArgs changeElement = new MatrixEventArgs(row, column); this[row, column] = element; OnChangeMatrix(changeElement); }
/// <summary> /// Method starts after event running. /// </summary> /// <param name="sender">object which runs event</param> /// <param name="e">additional information about diagonal matrix</param> protected override void Info(object sender, MatrixEventArgs e) => Console.WriteLine($"Diagonal matrix[{e.Rows},{e.Columns}] is changed !");
/// <summary> /// On change element /// </summary> /// <param name="sender"> /// Sender /// </param> /// <param name="eventArgs"> /// EventArgs /// </param> protected virtual void OnChangeElement(object sender, MatrixEventArgs <T> eventArgs) { EventHandler <MatrixEventArgs <T> > tmp = ChangeElement; tmp?.Invoke(sender, eventArgs); }
/// <summary> /// Invokes ElementChanged event. /// </summary> /// <param name="sender">Sender of the event.</param> /// <param name="args">Arguments of the event.</param> protected virtual void OnElementChanged(object sender, MatrixEventArgs <T> args) { var temp = ElementChanged; temp?.Invoke(sender, args); }
/// <summary> /// method starts event /// </summary> /// <param name="e">additional information about object</param> private void OnChangeMatrix(MatrixEventArgs e) => changeMatrix?.Invoke(this, e);
/// <summary> /// Method starts after event running. /// </summary> /// <param name="sender">object which runs event</param> /// <param name="e">additional information about object</param> protected abstract void Info(object sender, MatrixEventArgs e);
protected virtual void OnElementChanged(object sender, MatrixEventArgs <T> eventArgs) { EventHandler <MatrixEventArgs <T> > temp = this.ElementChanged; temp?.Invoke(sender, eventArgs); }