Browsing 7239 questions and answers with Jon Skeet
You could either create a specific class for this, as per the answer from Boas, or just use an anonymous type: return Ok(new { CountryList = list }); Basically, you need an object with the appropriate property, one way or the other. If... more 11/27/2015 9:50:24 AM
Now that we've finally got a repro, the problem is simply that menuItemActionMethod is being called on a different instance of Main to the start method. Not being a JavaFX developer, I can't easily follow the code flow here, but you can... more 11/27/2015 9:34:17 AM
There's no LINQ in that code - just a lambda expression. You can use an anonymous method instead: private void cmdCaculator_Click(object sender, EventArgs e) { int rowcount = gridView1.RowCount; Thread myThr = new... more 11/27/2015 7:44:15 AM
In this line: double i = 0xF0000000; the literal is of type uint, but it's being implicitly converted to a double. When you call i.GetType() that would always print System.Double, because the variable is of type double... the only kind... more 11/27/2015 6:51:46 AM
I don't know any languages which are pass-by-reference all the time, but C# has the ref modifier which allows a specific parameter to use pass-by-reference. That allows you to see the difference pretty easily. For example: using... more 11/26/2015 8:38:03 AM
Not quite... but you could make it a delegate instead: Func<bool> thereIsNotAProblem = () => { /* some expression */ }; Console.WriteLine(thereIsNotAProblem()); // true thereIsAProblem =... more 11/25/2015 4:30:13 PM
but when it enters in NotifyPropertyChangd method the value of PropertyChanged is null That just means that nothing has subscribed to the event yet. Beyond events, a delegate instances refers to one or more actions to execute when the... more 11/25/2015 9:52:38 AM
The problem is with this piece of code which does the actual shifting: if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')) { temp = (int)(a[i] + shift); if ((c >= 'A' && c <= 'Z'... more 11/25/2015 7:16:39 AM
No, it's not a bug. It's just an impedance mismatch between the C# language rules (which claim there's no conversion available) and the CLR rules (where the conversion is available). Note that the compiler really, really thinks it knows... more 11/24/2015 2:35:53 PM
I'm pretty sure it's actually the GetType method which is returning null - because there's no type with the fully-qualified name ReflectionWithLateBinding.Calculator. Your Calculator class is nested within your Program class. It's the... more 11/24/2015 2:32:32 PM