I am using CodeModel inside of a T4 template to generate some code based from an interface. I am able to get the interface methods, parameter names, and parameter types but I can't seem to be able to find out wither the parameter is an out
or ref
parameter.
http://msdn.microsoft.com/en-us/library/envdte.codeparameter.aspx
foreach ( CodeElement child in func.Children )
{
CodeParameter param = child as CodeParameter;
if ( param != null )
{
开发者_运维知识库 Write("{0}{1} {2}", nextString, param.Type.AsString, param.Name);
nextString = ", ";
}
}
Any ideas on how to get this information?
http://www.visualstudiodev.com/visual-studio-extensibility/codemodel-alternatives-11973.shtml
According to that link you can cast it to CodeParameter2 and which has a property ParameterKind which differenciates ref and out.
精彩评论