Browsing 7239 questions and answers with Jon Skeet
I would suggest having a Dictionary(Of String, Type) instead - that keeps all the information in a single place, and means you can perform the mapping programmatically. You could make another mapping in the other direction as well, of... more 10/8/2013 7:15:45 AM
However, the last parts of the string is not being printed. Yes, that's right - because of your loop condition. You're iterating (string.length()/5) times - which rounds down. So if the string has 12 characters, you'll only iterate... more 10/8/2013 6:18:26 AM
Could anyone suggest what could be wrong? You've put a switch statement in the middle of a class declaration. Statements like this must be in methods or constructors. You haven't given much context here, but you might want something... more 10/8/2013 5:56:52 AM
The only type-based access would be nested types. If you nest one type within another, the nested type has access to all the members of the enclosing class, including private members. The nested type can also be private. For... more 10/8/2013 5:52:13 AM
I would just use LINQ to XML in the simplest possible way: var query = from file in files let doc = XDocument.Load(file) from customer in doc.Descendants("Customer") select new { Company... more 10/7/2013 3:14:38 PM
You can effectively overload the return type using explicit interface implementation: Driver IDriverService.New() { return New(); // Calls the method below } public SubclassOfDriver New() { return new SubclassOfDriver(); } Now... more 10/7/2013 2:04:10 PM
Given these two Instant called previousRun and nextRun, and the DateTimeZone called tz how would I determine whether the localTime called eightAM falls between the bounds of this job run? Doing this in a general way is somewhat... more 10/7/2013 1:03:55 PM
Or more precisely, what is the proper way of reaching EOF with bufferedReader reading from console? Currently you're actually detecting the characters '^' and 'z' it's not like '^' is really a control character. The exception you're... more 10/7/2013 8:08:40 AM
You're ignoring this: xmlns="http://schemas.microsoft.com/developer/msbuild/2003" That sets the default namespace for descendants. So you want: XNamespace ns = "http://schemas.microsoft.com/developer/msbuild/2003"; var elem =... more 10/7/2013 6:22:18 AM
It sounds like you just want string.Join: string commaSeparated = string.Join(",", list); (Note that this is not part of LINQ - it's not the same kind of "join" as for joining multiple sequences. It's joining several strings together... more 10/6/2013 5:18:14 PM