Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need Assistance With This Syntax
Message
 
À
26/04/2010 20:43:33
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01462114
Message ID:
01462120
Vues:
56
OK, I see. But could you step it through a bit? What happens when the event fires? It calls the code after the "=>"?


>>I don't understand this:
>>
>>     this.PropertyChanged += (sender, e) =>
>>

>It's what's called an anonymous delegate. You can use that syntax instead of code like this:
>
>
>     this.PropertyChanged += new EventHandler(MyPropertyChangedHandler);
>
>     private void MyPropertyChangedHandler(object sender, EventArgs e)
>     {
>         if (this.RowState == RowStateEnum.Unchanged && this.AllowRowStateChange)
>             this.RowState = RowStateEnum.Update;
>     }
>
>
>~~Bonnie
>
>
>
>
>>I have this code:
>>
>>
>>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;
>>     };
>>  }
>>}
>>}
>>
>>I don't understand this:
>>
>>     this.PropertyChanged += (sender, e) =>
>>
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform