Mat*_*hew 5 .net c# syntax notation async-await
我在C#5.0中阅读Async,编译器转换部分包含以下代码段:
public Task<int> AlexsMethod()
{
<AlexsMethod>d__0 stateMachine = new <AlexsMethod>d__0();
stateMachine.<>4__this = this;
stateMachine.<>t__builder = AsyncTaskMethodBuilder<int>.Create();
stateMachine.<>1__state = -1;
stateMachine.<>t__builder.Start<<AlexsMethod>d__0>(ref stateMachine);
return stateMachine.<>t__builder.Task;
}
Run Code Online (Sandbox Code Playgroud)
有两段符号对我来说是新的.首先是<AlexsMethod>d__0.第二是stateMachine.<>4__this.当我自己尝试时它们都不起作用,所以我怀疑它只供编译器使用.但是我在搜索有关这种符号的意图的更多信息时遇到了麻烦.
| 归档时间: |
|
| 查看次数: |
1079 次 |
| 最近记录: |