Browsing 7239 questions and answers with Jon Skeet
Disclaimer: I haven't actually used Roslyn in anger much at all. Currently your code declares a variable, but doesn't do anything with it afterwards. Based on this random blog post, it looks like you possibly just need an extra expression... more 3/18/2014 3:06:52 PM
IllegalStateException seems entirely appropriate here: Signals that a method has been invoked at an illegal or inappropriate time. That describes the situation reasonably clearly, doesn't it? more 3/18/2014 3:00:37 PM
Currently you're just looking at the fields themselves - you're interested in the values of those fields. For example: Object value = fld[i].get(target); // Or null for static fields if (value == label5) { ... } Here target is a... more 3/18/2014 9:31:18 AM
I'd store the assembly-qualified name, assuming the assembly will still be present later: binaryWriter.Write(type.AssemblyQualifiedName); ... string typeName = binaryReader.ReadString(); Type type = Type.GetType(typeName); If you... more 3/18/2014 8:31:15 AM
why this code is giving me nosuchmethod exception? Because you don't have a constructor with the parameters you've requested: (int, char, String, String) You only have a constructor with these parameters: (int, char,... more 3/18/2014 7:03:02 AM
A Map stores key/value pairs, with only one value per key. So if you're calling put with the same key multiple times, then it will correctly stick to the same size, only having a single entry for that key. more 3/17/2014 10:33:32 PM
But the direct child elements do have an empty xmlns attribute. How can I avoid that? You specify the namespace for the child elements as well: doc.Root.Add(new XElement(ns + "SomeChildElement")); The point is that elements inherit... more 3/17/2014 10:12:09 PM
The problem is that this call is dynamic: userService.SignIn(openId, email, Callback); It has to be, because openId and email are inferred to be of type dynamic: var openId = meResult.id; var email = meResult.emails.preferred; You... more 3/17/2014 10:05:46 PM
It's somewhat painful to do so. You basically need to declare a local variable, give it a temporary value (so that it's definitely assigned) and then use that local variable: QueryPropertyMessage message = null; message = new... more 3/17/2014 6:56:06 PM
You've only initialized as far as polje[1][...]. So when i is 2 (and j is anything), polje[i][j] will be null... and when you dereference it by calling charAt(0), you'll get the exception. Note that this sort of error can be avoided using... more 3/17/2014 4:06:25 PM