1.詞匯
- variable 變量
2.例句
-
the technique of separating the two concerns like this makes it very easy to change the condition you’re testing for and the action you take on each of the matches independently.
像這樣分離兩個關(guān)注點(diǎn)的技術(shù)使我們可以輕松的改變測試條件并對每個匹配性采取單獨(dú)的操作涛贯。
-
The delegate variables involved (test and print) could be passed into a method, and that same method could end up testing radically different conditions and taking radically different actions.
涉及到的委托變量(test和print)可以傳遞給一個方法颗圣,相同的方法可以用于測試完全不同的條件及執(zhí)行完全不同的操作决瞳。
-
you could put all the testing and printing into one statement。
你也可以把testing和printing兩個方法直接放到一行代碼中。
3.代碼
- 用一句話表達(dá)
List<Product> products = Product.GetSampleProducts();
products.FindAll(delegate(Product p) {
return p.Price > 10;})
.ForEach(Console.WriteLine);