<p>I want to create a list of methods to execute.  Each method has the same signature.
I thought about putting delegates in a generic collection, but I keep getting this error:</p>

<blockquote>
  <p>'method' is a 'variable' but is used like a 'method'</p>
</blockquote>

<p>In theory, here is what I would like to do:</p>

<pre><code>List&lt;object&gt; methodsToExecute;

int Add(int x, int y)
{ return x+y; }

int Subtract(int x, int y)
{ return x-y; }

delegate int BinaryOp(int x, int y);

methodsToExecute.add(new BinaryOp(add));
methodsToExecute.add(new BinaryOp(subtract));

foreach(object method in methodsToExecute)
{
    method(1,2);
}
</code></pre>

<p>Any ideas on how to accomplish this?
Thanks!</p>

Have them all implement of common interface, say IExecuteable, and then have a List<IExecutable>
Also, using delegates:
```
```
class Example
{
    public delegate int AddDelegate(int x, int y);

    public List<AddDelegate> methods = new List<AddDelegate>();

    int Execute()
    {
        int sum = 0;
        foreach(AddDelegate method in methods)
        {
            sum+=method.Invoke(1, 2);
        }
        return sum;
    }
}
```
```