>>> this.PropertyChanged += (sender, e) =>
>>>
>> this.PropertyChanged += new EventHandler(MyPropertyChangedHandler); >> >> private void MyPropertyChangedHandler(object sender, EventArgs e) >> { >> if (this.RowState == RowStateEnum.Unchanged && this.AllowRowStateChange) >> this.RowState = RowStateEnum.Update; >> } >>>>
>>>namespace ConfigManager.ChangeSetEngine >>>{ >>> [Serializable] >>>public partial class TblFacility : SQLEntityBaseClass, INotifyPropertyChanged >>>{ >>> partial void OnCreated() >>> { >>> this.PropertyChanged += (sender, e) => >>> { >>> if (this.RowState == RowStateEnum.Unchanged && this.AllowRowStateChange) >>> this.RowState = RowStateEnum.Update; >>> }; >>> } >>>} >>>}>>>
>>> this.PropertyChanged += (sender, e) =>
>>>
The syntax is actually a bit more than an anonymous delegate since it uses a statement lambda.//Anonymous delegate (assuming Bonnie's property types): this.PropertyChanged += delegate(object sender, EventArgs e) {//statement block....}; //Lambda equivalent: this.PropertyChanged += (object sender, EventArgs e) => {}; // But since the compiler can infer the input types: this.PropertyChanged += (sender,e) => {};'=>' can be regarded as meaning 'goes to' so, although you weren't using the inputs in the example they would be available in the statement block (and, yes, it runs the code after the =>)