编译器错误 CS0762
更新:2007 年 11 月
错误消息
无法通过方法“method”创建委托,因为该方法是没有实现声明的分部方法
分部方法不要求具有实现声明。但委托要求其封装方法具有实现。
更正此错误
- 为用于初始化委托的方法提供一个实现。
示例
public delegate void TestDel();
public partial class C
{
partial void Part();
public static int Main()
{
C c = new C();
TestDel td = new TestDel(c.Part); // CS0762
return 1;
}
}