Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
C# equivalent of VB With - Endwith
Message
From
11/04/2012 21:46:28
 
 
To
All
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
C# equivalent of VB With - Endwith
Miscellaneous
Thread ID:
01541144
Message ID:
01541144
Views:
104
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.
Next
Reply
Map
View

Click here to load this message in the networking platform