what is the meaning of “ += ( s, e )” in the code?

前端 未结 4 1064
无人及你
无人及你 2021-02-06 11:22

What is exactly the += ( s, e ) in the code?

example:

this.currentOperation.Completed += ( s, e ) => this.CurrentOperationChanged();

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-06 11:46

    This codes adds an event listener in form of a Lambda expression. s stands for sender and e are the EventArgs. Lambda for

    private void Listener(object s, EventArgs e) {
    
    }
    

提交回复
热议问题