私は新しい非同期CTPを研究していて、いくつかのサンプルコードを調べています。
私はこのコードに出くわしました:
public async void button1_Click(object sender, EventArgs e)
{
string text = txtInput.Text;
await ThreadPool.SwitchTo(); // jump to the ThreadPool
string result = ComputeOutput(text);
string finalResult = ProcessOutput(result);
await txtOutput.Dispatcher.SwitchTo(); // jump to the TextBox’s thread
txtOutput.Text = finalResult;
}
ThreadPool.SwitchToはどこにありますか?SwithcToメソッドはThreadPoolクラスにありません
AsyncCtpLibrary.dllへの参照があります...しかし運がありません