It's hard to explain in the title but I have a form I created in Code DOM using
Code:
public class Form1 : Form
{
...
}
Than I have the
Code:
public Form1()
{
InitializeComponent();
}
I also need. But I tried making that a method of the class of the form and it complained about having the same name as the class.
This is my code dom main class:
Code:
myclass = new CodeTypeDeclaration();
myclass.Name = "Form1 : Form";
myclass.IsClass = true;
myclass.Attributes = MemberAttributes.Public;
mynamespace.Types.Add(myclass);
And here is the method I am trying to add to that class:
Code:
CodeMemberMethod Form3 = new CodeMemberMethod();
Form3.Name = "Form1";
Form3.Attributes = MemberAttributes.Public;
myclass.Members.Add(Form3);
Did I do somthing wrong in the class or what?