News for hackers. Stuff that matters.
Re:Explicit vs. Clever by jimmaswell on Tuesday April 02, 2013 @09:27PM (#5483568)
The c# syntax, myNewList = (from i in myList where i > 3 && i != 7 select i * 4).toList(), is nice too. Similar to using LINQ, myList.Where(i => i > 3), but I don't believe that form allows an easy use of the i * 4 part. One annoyance I have with .NET is there are too many types that are similar-but-not-quite a List<>, making me do conversions often. At least it's usually not much more than a .ToList(), except in the case of the controls in a Windows Form, which are their own weird list-type structure that doesn't support that.
Re:Explicit vs. Clever by dbattaglia on Thursday April 04, 2013 @07:59AM (#5492114)
For older .Net collections you can use Cast<T>() to get LINQ goodness. Something like this would work:

  var values = from x in combobox.Items.Cast<ComboBoxItem>() where x.Value > 5 select x.Value;