From MSDN doc:
A delegate is a type that safely encapsulates a method, similar to a
function pointer in C and C++. Unlike C function pointers, delegates
are object-oriented, type safe, and secure.
I know what it is and how to use it. But I wonder whether or not it is written base on delegate pattern that I know (from wikipedia) .
What is the difference between them?
The C# (not the pattern) delegate might be useful when you are implementing the delegate pattern just look at this delegate pattern implementation from wikipedia with my changes:
Again delegate might be useful here, but it isn’t for it was introduced. You should look at it like on the low-level construction rather then the pattern. In the pair with the events it could be used to implement publisher/subscriber(observer) pattern – just look at this article, or it could sometimes help you to implement visitor pattern – this is actively used in the LINQ:
To summarize: a language delegate is not the pattern itself, it just allows you to operate functions as the first class objects.