Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Delegate explanation
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00649150
Message ID:
00649504
Vues:
10
>I was hoping someone here could give me a good explanation of delegates and why I want to use them. I know of a few benefits of them (eg. things like wrapping other code to allow you to spawn a thread, or something to that effect). But every definition I've seen basically says: "Delegates are type-safe function pointers". Yeah...OK...I'm sure that's technically correct, but it doesn't help. I just can't get my head around that definition. I understand what they're saying (I think), but I'm not seeing the point. Anyone want to take a crack at this?

This is a comment, not an explanation.

From a course in C# I got something like what Mike Helland explained, except that there is, somewhere that I don't recall, a step where you pass a reference to a function. This last aspect highlighted the hoops one has to go through because in C# you cannot pass the string "MyObject.MyMethod()" and run it via macro. Who says macros are not cool?

After that class I was reminded of W.C. Fields comment "The more I know people, the more I love my dog".

Alex
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform