Browsing 7239 questions and answers with Jon Skeet
Since this within the context of an explicit interface implementation can only possibly be of type Profile and we know it was accessed through the Profile interface rather than that of the containing class or any other interface it... more 3/16/2016 11:03:24 PM
I don't believe there's a calendar field for "millisecond of day", but you could use: long millisecondOfDay = TimeUnit.HOURS.toMillis(cal.get(Calendar.HOUR_OF_DAY)) + TimeUnit.MINUTES.toMillis(cal.get(Calendar.MINUTE)) + ... more 3/16/2016 1:04:43 PM
The control returns to user before all tasks are done. Yes, that's how async works. Instead of having an async void method, you should make it async Task - and then make your Sync_Click method async as well, so you can await the... more 3/16/2016 12:45:38 PM
It's just the Eclipse console not handling the Indian numbering system. When I run that same code on Linux in a shell, I get: २०१६-०३-१६ As noted by Alexandar, changing the Eclipse console encoding to one which includes all the required... more 3/16/2016 9:04:36 AM
No. Basically, if your code is running on the user's device, and your code needs the information, then you should expect the user to have access to the information. You can obscure it in various ways - e.g. encrypting it with a key which... more 3/16/2016 6:58:48 AM
Your join projects to this: (sn, pl) => new { pl.Id, pl.Category, sn.UserId } But your final assignment is to this: sn => new { sn.Id, sn.Category } They're not the same type, hence the problem. If the query is actually... more 3/15/2016 6:19:07 PM
Just call string.Format yourself: bw.Write(string.Format("{0}{\nAuth:{1}\nPass:{2}\nDateCreated:{3}", user, auth, pass, date)); Although if you're using C# 6, you can make this cleaner using interpolated... more 3/15/2016 5:09:15 PM
I suspect you can use a R# annotation for this. Something like: [ContractAnnotation("null => true")] public static bool IsEmpty<T>(this IEnumerable<T> source) { return source == null || !source.Any(); } I believe that... more 3/15/2016 9:36:30 AM
You just need to constrain T with a class type constraint. You can also add a new() constraint to make the code simpler: private void ShowForm<T>(T form) where T : Form, new() { // Check if the Form already exists. Create it if... more 3/14/2016 10:20:26 AM
Before you try to extract the num value, you need to fix your Where clause - at the moment you're comparing a string with an integer. The simplest fix - if you know that your XML will always have an id element which has a textual value... more 3/14/2016 7:11:02 AM