在.NET中了解有关标准事件模型的更多信息时,我发现在引入C#中的泛型之前,处理事件的方法由此委托类型表示:
//
// Summary:
// Represents the method that will handle an event that has no event data.
//
// Parameters:
// sender:
// The source of the event.
//
// e:
// An object that contains no event data.
public delegate void EventHandler(object sender, EventArgs e);
Run Code Online (Sandbox Code Playgroud)
但是在C#2中引入泛型之后,我认为这个委托类型是使用泛型重写的:
//
// Summary:
// Represents the method that will handle an event when the event provides data.
//
// Parameters:
// sender:
// The source of the event.
//
// e:
// …Run Code Online (Sandbox Code Playgroud) 我可以知道C#4.0和C#2.0之间的区别是什么?C#4.0是否向后兼容C#2.0?
我可以说C#4.0是C#2.0的超集(就像C++到C的那样)吗?
谢谢.