I am trying to use the codedom to create an assembly that will simply return a number. The real method looks like this:
The CodeDom statments to create this would be something like this:
How would the last statement look? Seems like it should be easy but theirs not many good examples out there.
Code:
Public Class Class1
Public Function GetR ()
Return 255
End Function
End Class
The CodeDom statments to create this would be something like this:
Code:
Dim Class1 As New CodeTypeDeclaration("Class1")
TheName.Types.Add(Class1)
Dim GetR As New CodeMemberMethod()
GetR.Name = "GetR"
GetR.ReturnType = New CodeTypeReference(GetType(Integer))
GetR.Statements.Add(New CodeMethodReturnStatement(New CodeMethodInvokeExpression()))
How would the last statement look? Seems like it should be easy but theirs not many good examples out there.