Click here to Skip to main content
15,894,896 members
Home / Discussions / C#
   

C#

 
AnswerRe: Compress and decompress string between java and c# Pin
Luc Pattyn8-Dec-11 9:06
sitebuilderLuc Pattyn8-Dec-11 9:06 
GeneralRe: Compress and decompress string between java and c# Pin
Hossein Khalaj8-Dec-11 9:10
Hossein Khalaj8-Dec-11 9:10 
QuestionClass to toggle a bool when it goes out of scope Pin
__John_8-Dec-11 3:58
__John_8-Dec-11 3:58 
AnswerRe: Class to toggle a bool when it goes out of scope Pin
PIEBALDconsult8-Dec-11 4:12
mvePIEBALDconsult8-Dec-11 4:12 
AnswerRe: Class to toggle a bool when it goes out of scope Pin
__John_8-Dec-11 5:03
__John_8-Dec-11 5:03 
GeneralRe: Class to toggle a bool when it goes out of scope Pin
harold aptroot8-Dec-11 5:21
harold aptroot8-Dec-11 5:21 
GeneralRe: Class to toggle a bool when it goes out of scope Pin
__John_11-Dec-11 22:15
__John_11-Dec-11 22:15 
GeneralRe: Class to toggle a bool when it goes out of scope Pin
harold aptroot11-Dec-11 22:34
harold aptroot11-Dec-11 22:34 
Well maybe. But it's "invisible logic". That something happens even if you forget it may seem nice, but it's the dirtiest possible side effect if } executes code. Combined with threading it would be the recipe for certain disaster. In C# you can't even do it without abusing using, which is meant for disposing things, not for "doing whatever".
As for MS doing it, well they can't rely on programmers doing what they're supposed to do. But if you are the programmer, certainly you can do what you tell yourself to do. You do it all the time, and forgetting to do so is called a bug.
Anyway here's a suggestion: don't have multiple return points. Problem solved.
If you really want multiple return point, you could wrap the whole thing in a try/finally. You won't have to remember "the thing" all the time (just once ... same as when using using), and the side effect is explicit.
GeneralRe: Class to toggle a bool when it goes out of scope Pin
__John_12-Dec-11 0:28
__John_12-Dec-11 0:28 
GeneralRe: Class to toggle a bool when it goes out of scope Pin
BobJanova8-Dec-11 5:45
BobJanova8-Dec-11 5:45 
QuestionDisplay HTML data as a webpage in C# control Pin
sarang_k8-Dec-11 1:48
sarang_k8-Dec-11 1:48 
AnswerRe: Display HTML data as a webpage in C# control Pin
Ravi Bhavnani8-Dec-11 2:07
professionalRavi Bhavnani8-Dec-11 2:07 
QuestionRe: Display HTML data as a webpage in C# control Pin
sarang_k11-Dec-11 19:16
sarang_k11-Dec-11 19:16 
QuestionWebBrowser : how to show popup window? Pin
Sunil P V8-Dec-11 0:49
Sunil P V8-Dec-11 0:49 
Questionconvert wsdl inline schema imports into xsd Pin
Agweet7-Dec-11 19:50
Agweet7-Dec-11 19:50 
QuestionAdd context menu in windows explorer in c# 2010 Pin
iamdking7-Dec-11 19:19
iamdking7-Dec-11 19:19 
AnswerRe: Add context menu in windows explorer in c# 2010 Pin
Richard MacCutchan7-Dec-11 22:02
mveRichard MacCutchan7-Dec-11 22:02 
GeneralRe: Add context menu in windows explorer in c# 2010 Pin
iamdking7-Dec-11 22:50
iamdking7-Dec-11 22:50 
QuestionHow to make different color in different trangle in WPF Pin
derek09197-Dec-11 14:07
derek09197-Dec-11 14:07 
AnswerRe: How to make different color in different trangle in WPF Pin
derek09197-Dec-11 22:58
derek09197-Dec-11 22:58 
GeneralRe: How to make different color in different trangle in WPF Pin
Pete O'Hanlon7-Dec-11 23:15
mvePete O'Hanlon7-Dec-11 23:15 
GeneralRe: How to make different color in different trangle in WPF Pin
derek09198-Dec-11 2:45
derek09198-Dec-11 2:45 
QuestionRegenerate Designer Code File? Pin
Richard Andrew x647-Dec-11 11:53
professionalRichard Andrew x647-Dec-11 11:53 
AnswerRe: Regenerate Designer Code File? Pin
PIEBALDconsult7-Dec-11 11:57
mvePIEBALDconsult7-Dec-11 11:57 
GeneralRe: Regenerate Designer Code File? Pin
Richard Andrew x647-Dec-11 11:59
professionalRichard Andrew x647-Dec-11 11:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.