Browsing 7239 questions and answers with Jon Skeet
Did I do something wrong? Yes. Your setter is just fetching the existing property value: this.btn_input.BackColor = buttonColor; this._buttonColor = buttonColor; You meant to use value, which is the implicit parameter name for the... more 5/17/2017 6:13:04 PM
Basically, when you call new SqlCommand(), that will only work with a SqlConnection. It's not going to work for MySqlConnection, or for anything from Oracle etc. SqlCommand is tightly coupled to SqlConnection. So either you need a... more 5/16/2017 12:35:05 PM
The exception being declared isn't about what that implementation can throw - it's about what that implementation or the implementation in subclasses can throw. Service is an abstract class - and so are the two direct subclasses... more 5/16/2017 11:32:09 AM
No, you shouldn't. You've asked for a ZonedDateTime with the same LocalDateTime that you started with, but associated with a particular time zone. From the docs for LocalDateTime.atZone: This returns a ZonedDateTime formed from this... more 5/16/2017 10:51:08 AM
Why is it so? Isn't Auto-Property Initializer actually translated into constructor code in IL? The rules for automatically implemented property initializers are the same as those for field initializers, for the same reason. Note that... more 5/15/2017 10:33:24 AM
From the Javadoc of divide(BigDecimal, RoundingMode): Returns a BigDecimal whose value is (this / divisor), and whose scale is this.scale() The last part is important - the scale of your initial value is 2 (the unscaled value is... more 5/15/2017 8:32:00 AM
I suspect you just want to get the semantic model, ask it for the symbol, and get the attributes: // After you've made sure that you've got an InvocationExpressionSyntax var model = await context.Document ... more 5/14/2017 6:46:34 PM
Assuming you're trying to associate each text box with a different label, you'll need to write a method that constructs an EventHandler for the relevant label, e.g. public EventHandler CreateVisibilityHandler(Label label) { return... more 5/14/2017 11:38:39 AM
You're explicitly starting a new task using Task.Factory.StartNew(). That's almost always going to run in a non-UI thread. The async/await way of doing this is not to start a new task on a different thread, not to use the dispatcher, and... more 5/13/2017 10:22:09 AM
I presume it meant, that x++ is done before ++x. No, it doesn't mean that. I've previously blogged about how I find viewing precedence in terms of execution order is problematic. It may well be valid in a computer-science-strict way,... more 5/12/2017 2:40:14 PM