A
Abhi
I am using CodeDOM namespace to dynamically generate code in C#. But when I
am creating method using “CodeMemberMethod†then its creating a virtual
method even though I am not specifying anything to create a virtual method. I
am using following code to add method:
CodeMemberMethod testMethod = new CodeMemberMethod();
testMethod.Name = "testMethod";
testMethod.Attributes = MemberAttributes.Public;
testMethod.Statements.Add(new CodeSnippetStatement("//TODO: Code goes
here....."));
testClassType.Members.Add(testMethod);
Question: How to create method without Virtual keyword?
am creating method using “CodeMemberMethod†then its creating a virtual
method even though I am not specifying anything to create a virtual method. I
am using following code to add method:
CodeMemberMethod testMethod = new CodeMemberMethod();
testMethod.Name = "testMethod";
testMethod.Attributes = MemberAttributes.Public;
testMethod.Statements.Add(new CodeSnippetStatement("//TODO: Code goes
here....."));
testClassType.Members.Add(testMethod);
Question: How to create method without Virtual keyword?