8
일반 대리자 매개 변수로 제공 될 때 람다 식을 캐스팅해야하는 이유
System.Windows.Forms.Control.Invoke (Delegate method) 메서드를 사용합니다. 왜 컴파일 시간 오류가 발생합니까? string str = "woop"; Invoke(() => this.Text = str); // Error: Cannot convert lambda expression to type 'System.Delegate' // because it is not a delegate type 그러나 이것은 잘 작동합니다. string str = "woop"; Invoke((Action)(() => this.Text = str)); 메소드가 …