Try something like this:
CodeTypeReference typeRef = new CodeTypeReference("MyType");
CodeTypeOfExpression typeofValue = new CodeTypeOfExpression(typeRef);
Statements.Add( new CodeAssignStatement(
new CodeFieldReferenceExpression(new CodeThisReferenceExpression(),
someVar) ,
typeofValue) );
Lionel.
<Th********@gmail.com> a écrit dans le message de news:
11**********************@l41g2000cwc.googlegroups. com...
I have the need to generate the following code:
Type someVar = typeof(MyType);
I know how to declare the var and can intialize vars except in this
case.
I can't figure out how to get the codedom to generate a cll to typeof.
Any help would be appreciated.