codedom member field

  • Thread starter Thread starter Jarlaxle
  • Start date Start date
J

Jarlaxle

Does anyone know why the codedom puts a '@' next to the type when generating
a field? does anyone know how to get rid of it?...

CodeMemberField member = new CodeMemberField("bool" , "_boolfield");
classtype.Members.Add(member);

creates...

private @bool _boolfield;


Thanks.
 
Jarlaxle said:
Does anyone know why the codedom puts a '@' next to the type when generating
a field? does anyone know how to get rid of it?...

CodeMemberField member = new CodeMemberField("bool" , "_boolfield");
classtype.Members.Add(member);

creates...

private @bool _boolfield;

That's to avoid it being confused with the keyword "bool" in C#.

Basically it thinks you're trying to refer to a type called "bool"
instead of System.Boolean.
 
is there a way to tell it not to do that?

I have some types read in as strings from a file. the types could be
user-defined or primitive types.

i just want it to use whatever string i tell it to.
 
Jarlaxle said:
is there a way to tell it not to do that?

I have some types read in as strings from a file. the types could be
user-defined or primitive types.

i just want it to use whatever string i tell it to.

I don't know, to be honest. You might want to just have a map from the
primitive names to the CLR types.
 
Back
Top