I have just seen following code:
class X
{
static Action Ac()
{
return ..some other code
}
}
What does it mean? I have never seen a delegate with its body declared.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That’s not an
Actiondelegate with its body declared. That’s a static method of theXclass calledAc(), with a return type ofAction; that is, it’s a class method that returns anActiondelegate. The body presumably creates anActionobject to return from the method.To put it another way: it is a regular static method, which happens to return
Actioninstead of something likestringorint.