Browsing 7239 questions and answers with Jon Skeet
You're calling destroyAfterCBEvent, when you actually want to use a method group conversion to create a delegate to subscribe to the event. You need to take the brackets off (which is what makes it a method call). You... more 5/21/2014 5:54:41 AM
EDIT: This answer assumed that tags was a collection of strings... It sounds like you might want: var list = new List<string> { ... }; var query = query.Where(x => x.tags.Any(tag => list.Contains(tag)); Or: var list = new... more 5/20/2014 3:41:19 PM
It's only unloaded when the AppDomain that it's loaded into is unloaded, e.g. as part of a web app recycling. Any classes within the assembly stay loaded while the assembly is loaded, so therefore they stick around until the AppDomain is... more 5/20/2014 3:04:47 PM
It's because it's a COM interface. COM interfaces - and only COM interfaces - can be instantiated directly. The runtime will create an instance of the real type behind the scenes. Personally I think it's a bit ugly (and I can't find any... more 5/20/2014 2:58:15 PM
There isn't a monitor associated with a specific method - there's a monitor associated with an object. So if you're trying to synchronize on the same object in both methods, the second thread will block until the first thread releases the... more 5/20/2014 2:42:55 PM
It's a bug that you can use 0.0. The compiler implicitly treats all constant expressions with a value of zero as just 0. Now, it's correct for the compiler to allow an implicit conversion from a constant int expression of 0 to your enum... more 5/20/2014 2:28:18 PM
There's no particularly nice way of doing this, that I'm aware of. The best I've seen is just to cast - which you can do once, of course: public class Superclass<T extends Superclass<T>> { @SuppressWarnings("unchecked") ... more 5/20/2014 2:03:49 PM
Well if you really like query expressions, you can express the "filter and projection" and then use the Max extension method: var query = from p in ctx.FormControls where p.FormObjectsId == FormID select p.ID; var... more 5/20/2014 1:51:11 PM
Just assign the ActionListener to a different variable first: ActionListener listener = new ActionListener() { ... more 5/20/2014 1:27:51 PM
There are four things you need to understand: If you don't specify any explicit constructor call, the compiler inserts a call to super() for you. There must be exactly one constructor call for any constructor- either explicit or the... more 5/20/2014 1:03:02 PM