Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Newbie syntax question
Message
 
À
21/09/2010 09:44:04
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01482146
Message ID:
01482159
Vues:
55
>What I don't know and the course video does not say is why the steps to store the modules collection to a variable is required.
>
>Coming from a VFP background, if the collection is a property of an object I would just access that collection "directly", EG;
>

>
>If there a .Net reason for doing it this way? this is just one example, but there are lots through the samples of whenever there is a collection to address it is first stored to a variable.
>

No, there is no requirement to do this - you can access it directly. I'll sometimes assign it to a variable because it's a bit easier to test/view it in the debugger or (in loops, like your example) to avoid the overhead of hitting the property multiple times (it's faster to hold a reference directly to it in that case).
-Paul

RCS Solutions, Inc.
Blog
Twitter
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform