Browsing 7239 questions and answers with Jon Skeet
Question: how can it be that a Property is accessible in the debugger but not in the code? Because the debugger can show private, internal and protected members that your code doesn't have access to, basically. You can see this for... more 12/11/2015 10:21:15 AM
No, the output is what it is precisely because strings are immutable. Calling toUpperCase() doesn't change the contents of the existing string, it creates a new one and returns a reference to that... it has to do that, due to strings being... more 12/11/2015 10:04:58 AM
But if I want to add multiple records in my list once then what is the solution? You mean you want to add all the results? Assuming that lifeReductionByData is a List<T> for the appropriate type, you can just use... more 12/10/2015 9:33:48 PM
You're calling the delegate on the right thread - but the delegate itself then calls evnt.BeginInvoke, which executes the evnt delegate on the thread pool... so you still end up executing the real underlying delegate (in this case _Test,... more 12/10/2015 7:26:49 PM
You just need to specify the right format string when you call ParseExact. In your case, it looks like this is month-day-year, without any separators, and with a 2-digit year (blech). So you'd parse it like this: using System; using... more 12/10/2015 7:19:28 PM
There's nothing strange about this, and there isn't a -+ operator. There's a unary + operator and a binary - operator. Just add parentheses and some spacing to make it clearer: int a = 1; int b = 1; int c = a -+ b; int d = a - (+b); //... more 12/10/2015 5:34:12 PM
Nope, nothing's broken - but arrays don't override Equals or GetHashCode. So a HashSet<byte[]> is just checking for the presence of the exact object that the key refers to. It's not looking for "an array with an equivalent sequence... more 12/10/2015 3:13:22 PM
You're missing a dependency. If your code is not async, you shouldn't use Task.Delay... you should use Thread.Sleep() or normal. Just add the following dependency: "System.Threading.Thread": "4.0.0-beta-23516" Then you can use... more 12/10/2015 3:08:44 PM
Well yes - the actual code of Foo doesn't matter, because you're mocking it... and Mockito doesn't know there's meant to be a relationship between setName and getName. It doesn't assume that it should store the argument to setName and... more 12/10/2015 3:03:25 PM
I don't believe you can do this with the normal parsing code and the existing text. DateTime's precision only goes down to ticks, where a tick is 100 nanoseconds. I think the simplest thing to do is truncate the string itself: string... more 12/10/2015 2:48:11 PM