<p>I've been trying to create a Windows Media Player plugin in Visual Studio 2008, and am having great difficulty finding the correct template. MSDN provides advice <a href="http://msdn.microsoft.com/en-us/library/bb262076(VS.85).aspx" rel="nofollow noreferrer">here</a>, but it does not appear to be relevant to VS2008.</p>

<p>Can anyone suggest how to start a WMP plugin in Visual Studio?</p>

<p>EDIT: Ive accepted this answer because it worked for me, but I'm afraid it isn't the most elegant of solutions. If anyone has a better idea, please add it!</p>

Generics doesn't natively support arithmetic. However, it can be done with .NET 3.5,
like so
. The Operator class is part of
MiscUtil
. This then becomes:
```
```
public T Evaluate<T>(T x, T y) {
      switch (Operation)
      {
        case BinaryOp.Add:
            return Operator.Add(x, y);
        case BinaryOp.Subtract:
            return Operator.Subtract(x, y);
     ... etc
```
```
Since you are writing an expression parser, it might be a good idea to use Expression directly, but you're welcome to use the above.