1

Possible Duplicate:
C# 2.0 generics: How to create an Action object with zero parameters

I use code to delegate method like this:

this.Invoke((Action)(() => importProcessExited()));

And I'm getting an error:

Using the generic type 'System.Action' requires 1 type arguments.

How this line of code supposed to be in .NET 2?

Community
  • 1
  • 1
user1138470
  • 71
  • 1
  • 6
  • It will have to be rewritten as an anonymous delegate invocation http://msdn.microsoft.com/en-us/library/0yw3tz5k(v=vs.80).aspx Or back to a standard named delegate type. – asawyer Sep 12 '12 at 14:42

1 Answers1

3

You can simply create a new delegate without type arguments.

delegate void Action();
sloth
  • 99,095
  • 21
  • 171
  • 219