6
A
回答
7
它的lambda表達式是匿名委託的簡化的語法。它讀取'去'。相當於Dispatcher.BeginInvoke((Action)delegate() { trace.Add(response); });
1
=>是稱爲LAMBDA操作員的操作員
它用於創建lambda expression
2
=>是λ表達式運算符,它表明該代碼是λ表達式。
(param) => expr(int x) = > { return x + 1 };
或
param => exprx=> x + 1;>
什麼是Lambda表達式?
* Lambda expression is replacement of the anonymous method avilable in C#2.0 Lambda
expression can do all thing which can be done by anonymous method.
* Lambda expression are sort and function consist of single line or block of statement.
瞭解更多:Lambda Expressions
+1
「lambda」中有一個「b」 – phoog
1
0
它是λ操作者讀取像「變爲」
0
這種「=>」是指在C#中使用lambda表達式語法。
此語法自.NET 3.5(C#3.0)中的Visual Studio 2008起可用。這是MSDN official documentation of lambda expression in C#。
上面的代碼是一樣的匿名委託已經可用,因爲C#2.0
您的代碼:
Dispatcher.BeginInvoke((Action)(() => { trace.Add(response); }));
被翻譯成:
Dispatcher.BeginInvoke(new delegate() { trace.Add(response); });
這兩個代碼基本上具有相同的語義。
0
值得注意的是,單個表達式lambda不需要{}在身體周圍,也不需要分號,因此您可以簡化代碼(略)。
Dispatcher.BeginInvoke((Action)(() => trace.Add(response)));
相關問題
- 1. Groovy,什麼意思 - >意思是
- 2. 「=>」是什麼意思?
- 3. 「 - >」是什麼意思?
- 4. {< >}是什麼意思?
- 5. <+>是什麼意思?
- 6. <>是什麼意思?
- 7. <>是什麼意思?
- 8. 「outer =>」是什麼意思?
- 9. 「=>」是什麼意思?
- 10. `^^^`和`〜>`是什麼意思?
- 11. 「 - >」是什麼意思?
- 12. `()=> Unit`是什麼意思?
- 13. 是什麼意思:是什麼意思?
- 14. > +和> - 是什麼意思在C#
- 15. a >> = b是什麼意思?
- 16. >>和0xfffffff8是什麼意思?
- 17. 這是什麼意思? >> ActionController :: InvalidAuthenticityToken
- 18. 「somevar >> 0」是什麼意思?
- 19. 什麼是(int - > int) - >(int - > int)是什麼意思?
- 20. 「ptr = ptr - > next」這是什麼「 - >」是什麼意思? (C++)
- 21. =>在php中是什麼意思?
- 22. 數據( - >)a b是什麼意思?
- 23. 「<indentifier>預計」是什麼意思?
- 24. 這裏「2>&1」是什麼意思?
- 25. <String,String>是什麼意思?
- 26. 這是什麼意思? <variable> ==「」
- 27. 符號<>是什麼意思?
- 28. 「<!DOCTYPE html>」是什麼意思?
- 29. <[email protected]>是什麼意思?
- 30. #include <crtdll/stddef.h>是什麼意思?
此外,您正在查看的示例使得很難理解Lambda運算符的作用。請參閱下面的一些示例以及下面的鏈接。 –
不要忘記標記答案爲接受,如果你有你想要的信息' –
我認爲這個問題會引發很多有類似含義的答案。 –