Browsing 7239 questions and answers with Jon Skeet
This is the problem: AccountManager accountmanager= new AccountManager (account, t, accountmanager); You're declaring a variable, and trying to read from that variable in the same statement that gives it an initial value. Here's a... more 12/8/2017 4:49:56 PM
GetSystemDefaultId doesn't replace all the functionality of MapTimeZoneId - you don't want to call that here. Instead, use tzdbSource.WindowsMapping to get a WindowsZones that you can then use to find the TZDB ID. Here's some sample... more 12/8/2017 4:21:36 PM
TimeZoneInfo makes this reasonably simple - just add a day to the DateTime part of the value, check whether the result is skipped or ambiguous, and if not, ask the zone for the UTC offset. Here's a complete example showing all the... more 12/8/2017 9:46:26 AM
You can use Noda Time for this, parsing as a Duration. You could then convert it to a TimeSpan - or you could use Noda Time everywhere and have a nicer experience :) Sample code: using System; using NodaTime; using NodaTime.Text; class... more 12/7/2017 7:37:37 PM
DateTimeStyles isn't an operator - it's an enum, and all enums have the | operator. All it does is apply a bitwise | for the two values. It should only be used for flag-based enums. For example: public enum AccessMode { None = 0, ... more 12/7/2017 2:05:01 PM
Yes, that's correct. That's because the "Etc/GMT+X" zone IDs are confusing. They match POSIX TZ strings, which for some reason represent "the offset of UTC from local time" instead of the normal "offset of local time from UTC". See the... more 12/7/2017 7:26:52 AM
Your optimization hasn't just introduced inlining - it's changed ordering. That's not generally valid. In particular, it wouldn't be valid to change whether methods are called, unless the JIT can prove that those methods have no other... more 12/6/2017 8:23:08 PM
The problem isn't that Task.Wait isn't waiting long enough here - it's that you're assuming that as soon as you call Task.Factory.StartNew() (which you should almost never do, btw - use Task.Run instead), the task is started. That's not... more 12/6/2017 7:46:57 AM
Why is this needed? Why wouldn't GC ignore the objects which have a method running at that moment and also have a finalizer? Because that's not what the GC (or the C# specification) guarantees. The guarantee is that if an object won't... more 12/5/2017 3:12:31 PM
You're only printing one character when you print a single dot - you're not affecting the rest of the line. If you just change this: Console.WriteLine("."); to Console.WriteLine(". "); then it'll remove any characters written by... more 12/4/2017 7:25:41 AM