Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
C# equivalent of VB With - Endwith
Message
De
11/04/2012 21:46:28
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
C# equivalent of VB With - Endwith
Divers
Thread ID:
01541144
Message ID:
01541144
Vues:
105
Did not know this ( used a variable but didn't think of subscope )

Thanks to this article in Code Project
http://www.codeproject.com/Tips/202369/C-equivalent-of-VB-s-With-keyword

You are introducing a variable “p” in the local scope of the whole function :s
not really.. you know you can use brackets anywhere inside the code to define subscopes, don't you:
{
var p = this.StatusProgressBar;
p.IsIndeterminate = false;
p.Visibility = Visibility.Visible;
p.Minimum = 0;
p.Maximum = 100;
p.Value = percentage;
}


Charles Hankey

Though a good deal is too strange to be believed, nothing is too strange to have happened.
- Thomas Hardy

Half the harm that is done in this world is due to people who want to feel important. They don't mean to do harm-- but the harm does not interest them. Or they do not see it, or they justify it because they are absorbed in the endless struggle to think well of themselves.

-- T. S. Eliot
Democracy is two wolves and a sheep voting on what to have for lunch.
Liberty is a well-armed sheep contesting the vote.
- Ben Franklin

Pardon him, Theodotus. He is a barbarian, and thinks that the customs of his tribe and island are the laws of nature.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform