In order to "populate" a CodeDom class I can create a new field which allows me to generate random names for strings, bytes, etc. I then created a new method within my class via CodeDom but I am having a lot of trouble populating this method. I have found that I can use the CodeSnippetStatement method to add direct strings into the CodeDom method but I do not want to have to use direct strings. Is there some other way to populate a CodeDom method?
Here is what I am using now:
CodeMemberMethod method = new CodeMemberMethod();
method.name = "mainMethod";
method.Attributes = MemberAttributes.Public | MemberAttributes.Final;
// Here is where the code is added as a direct string:
method.Statements.Add(new CodeSnippetStatement("string myString = path.getTempPath();"));
myClass.Members.Add(method);
Namespaces.Types.Add(myClass);
Once again, I would like to know if there is a new method I could use to add data into a CodeDom method.
Thank you, Evan