Browsing 7239 questions and answers with Jon Skeet
Since, in UI thread based application, the UI thread is always available (unless the process is stopped explicitly or by Windows), so the ThreadPool thread responsible for executing the code after "await" in any async method, will... more 12/24/2013 7:16:13 PM
They would have a common set of methods, ie: "move", but their implementation would be different. That sounds like they should both implement the same interface or extend the same abstract superclass then. Use that interface or... more 12/24/2013 6:51:35 PM
It's not a matter of whether you've got VS.NET installed - it's a matter of whether you've got Json.NET in the right place. It's a third party library that you depend on, so you should ship it with your app. Personally I would copy it... more 12/24/2013 6:47:15 PM
It seems to me that it would be simpler to have the consonants as a string and then use charAt: private static final String CONSONANTS = "bcdfgh...z"; if (CONSONANTS.indexOf(word.charAt(word.length() - 2)) { ... } If you really... more 12/24/2013 6:38:06 PM
I want to convernt this numbers to one String which contains the hash-code as plaintext. The hash isn't plain-text. It's binary data - arbitrary bytes. That isn't plaintext any more than an MP3 file is. You need to work out what... more 12/24/2013 6:33:59 PM
Type.GetElementType is used for arrays, pointers, and by-ref parameter types. For example: object value = new int[100]; Console.WriteLine(value.GetType()); // System.Int32[] Console.WriteLine(value.GetType().GetElementType()); //... more 12/24/2013 11:52:03 AM
You can use ParameterInfo.HasDefaultValue and ParameterInfo.DefaultValue to detect this. You'd need to check whether the number of arguments you've been given is equal to the number of parameters in the method, and then find the ones with... more 12/24/2013 11:15:27 AM
I don't believe there's anything in the .NET framework which will parse time zone abbreviations - and for fairly good reason, given that they're not globally unique. It's a shame that RSS used such a brain-dead date/time format, to be... more 12/24/2013 11:04:27 AM
One simple answer is to have your own implementation of Connect which either exposes an isTransactional property, or which automatically commits when it's transactional, delegating everything else to an underlying connection: public class... more 12/24/2013 10:57:27 AM
You're currently looking for elements in the unnamed namespace - whereas the file you've linked to has a namespace URI of "http://www.adventure-works.com" for the elements you're looking for. Just use: XNamespace aw =... more 12/24/2013 10:48:39 AM