does anyone know a way to call a generic method of a base class with CodeDom?
I have no problem calling a standard method, but I can’t find a solution to call the generic.
The code I use to call the standard base class method GetInstance:
CodeAssignStatement assignStatement = new CodeAssignStatement( new CodeVariableReferenceExpression('instance'), new CodeMethodInvokeExpression( new CodeThisReferenceExpression(), 'GetInstance', new CodeExpression[] { new CodeVariableReferenceExpression('instance') } ));
You can find your answer here in msdn:
scroll down to the C# example (CodeDomGenericsDemo).
A generic method is generated:
and later executed in the example:
The code to generate the call to the method:
(You would use CodeThisReferenceExpression() or CodeBaseReferenceExpression() instead of the CodeVariableReferenceExpression), not sure if that is what you mean by calling the standard base class method.