i am declaring a class with the help of CodeTypeDeclaration like this :
CodeTypeDeclaration targetClass = new CodeTypeDeclaration(sType);
I can add a constructor :
CodeConstructor constructor = new CodeConstructor();
constructor.Attributes = MemberAttributes.Public;
Or a member field :
CodeMemberField myField = new CodeMemberField();
myField.Name = fieldName;
myField.Type = new CodeTypeReference(fieldType);
targetClass.Members.Add(myField);
But i am trying to add any kind of line , for example a constant declaration :
const addressFilteresErrorCounters: UInt32 = 0x0000AE77;
Can i do this without using CodeMemberField ? Maybe somehow i can add to the class a CodeSnippetStatement, so let's simply say , add some line to the class by the using the force and not filtering the declaration line with the CodeMemberField ?
Maybe smth like this :
targetClass.Members.Add(new CodeSnippetStatement("var n = 2"));
Thanks.