Browsing 7239 questions and answers with Jon Skeet
Firstly, you're not overriding the result() method - and indeed you can't, because it's not virtual. The compiler should be giving you a warning like this: warning CS0108: 'ClassB.result()' hides inherited member 'ClassA.result()'.... more 12/29/2014 9:44:26 AM
It is possible to solve this problem? Yes. The reason the serialization breaks is because the generated version number changes. If you specify this explicitly, it won't be generated, and you'll be in control of versioning. That means... more 12/29/2014 8:37:47 AM
Well, you could create a singleton class which would read the configuration on startup. Personally, however, I would investigate dependency injection. There are lots of DI frameworks in .NET, and that way you'll have code which is easier... more 12/28/2014 9:31:07 PM
The type of parent?.X is float?, which you're adding to a float - resulting in another float?. That can't be implicitly converted to float. While Yuval's answer should work, I would personally use something like: get { return... more 12/28/2014 4:54:52 PM
Three options spring to mind. Firstly, you can just structure your code to return from the Main method at that point. Unless you've got other (non-background) threads running, the application will then terminate. Alternatively, you can... more 12/28/2014 4:00:55 PM
I suspect the problem is that it's an inner class... so it doesn't actually have a parameterless constructor. Instead, it has two constructors, one of which takes a reference to an instance of the enclosing class, and one of which takes a... more 12/27/2014 8:47:35 PM
There are multiple problems here: You're trying to use a using directive for a class. You can't do that (before C# 6, anyway) - you either specify an alias for a class (which you don't want here) or you just specify a namespace in order... more 12/27/2014 8:42:29 PM
It's not entirely clear what value you want to compare. It's quite easy to see whether "now" is later than the start of the 1st of a particular month: // TODO: For testing purposes, you'd want a Clock abstraction to be injected. Date now... more 12/27/2014 9:00:56 AM
You're calling ExecuteNonQueryAsync to asynchronously insert the record - but you're then closing the connection immediately, while the insert has almost certainly not yet completed. You should either use the synchronous call instead, or... more 12/26/2014 10:00:05 PM
I strongly suspect that it's not hanging - it's just throwing an exception without you noticing. I'd expect it to throw a FileNotFoundException, which is what happens when I tried it. It's happening before readLine() because... more 12/26/2014 11:32:41 AM