CodeDOM question
How to create:
internal struct StructNam开发者_如何学运维e
{
public static byte[] Code = new byte[]
{
0, 0, 0, 0
};
}
in CodeDOM?
Thank you.
With out writing the code this should send you in the right direction.
Using CodeTypeDeclaration which you would use for making Classes etc has a IsStruct property set that to true.
Where type is = CodeTypeDeclaration.
That will then enable you to build the first part to make it internal you need to do
type.Attributes = MemberAttributes.FamilyAndAssembly; this will make it Internal.
You can then use type.Members.Add() and build up a member to do the rest in the standard way.
Thanks Alex
精彩评论