Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Limit to #region nesting?
Message
De
13/09/2011 15:58:16
 
 
À
13/09/2011 04:13:12
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 3.0
Divers
Thread ID:
01523118
Message ID:
01523462
Vues:
44
>>I'm probably a bit excessive, the change notification code makes properties fairly long in WPF, so I'll put each property into it's own #region and then wrap the whole properties section with a #region tag. But it makes it a lot quicker to find the property I'm looking for if I'm visually searching for it.
>
>I don't bother wrapping individual properties in a region - after all the are, themselves, collapsible. OTOH if your coding style involves placing a private backing variable next to the property declaration then wrapping the whole thing would appear cleaner.

Yep, I put the private field next to the property. (I use a macro for creating my properties so it's easier to do it that way.)

>I sometimes use regions around catch code since native outling doesn't work there and, at least for me, it makes the normal flow of execution easier to follow. e.g:
try
>{
>}
>#region Catch
>catch (Exception ex)
>{
>}
>#endregion
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform