Hi.

I am using CodeDom to autogenerate some files.

How do you declare a member variable as readonly? I
cannot find any suitable member of the MemberAttributes
enum.

Thanks in advance,
Mountain

http://groups.google.com/groups?q=MemberAttributes+readonly&hl=en&lr=&ie=UTF-8&safe=off&selm=12c3701c21de2%24b1a09220%24b1e62ecf%40tkmsftngxa04&rnum=1

Re: CodeDom question -- still unanswered from 2002! by cld

cld
Sat Jun 12 00:27:36 CDT 2004

In article <l3qyc.28742$HG.26238@attbi_s53>, mtnbikn@mediaone.net
says...
> Hi.
>
> I am using CodeDom to autogenerate some files.
>
> How do you declare a member variable as readonly? I
> cannot find any suitable member of the MemberAttributes
> enum.
>
> Thanks in advance,
> Mountain
>
> http://groups.google.com/groups?q=MemberAttributes+readonly&hl=en&lr=&ie=UTF-8&safe=off&selm=12c3701c21de2%24b1a09220%24b1e62ecf%40tkmsftngxa04&rnum=1
>
>
>
Are you generating CIL or some other higher language?

Re: CodeDom question -- still unanswered from 2002! by Mr

Mr
Sat Jun 12 09:41:17 CDT 2004

My primary interest is in generating C#.

"cld" <intrader@aol.com> wrote in message
news:MPG.1b3433eed748438d989686@news-
> >
> Are you generating CIL or some other higher language?



Re: CodeDom question -- still unanswered from 2002! by Gabriele

Gabriele
Sat Jun 12 13:43:44 CDT 2004

Do you mean a constant?

See the example here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemCodeDomCodeMemberFieldClassTopic.asp



Re: CodeDom question -- still unanswered from 2002! by Mr

Mr
Sun Jun 13 08:45:43 CDT 2004

Thanks, but I wasn't referring to a const.
ReadOnly is different.

However, I now realize that CodeDom is far from being able to represent all
the features of C# or VB.NET. Previously I had the mistaken impression that
I could do anything in C# with CodeDOM. Now I realize that CodeDOM can't
even do switch statements, etc (without using snippets). Therefore, I'm sure
it cannot do readonly fields.

This leaves two choices:
1. use code snippets and/or
2. use one of the alternative code generation techniques mentioned in the
new book I just received (Code Generation in Microsoft .Net).

Regards,
Mountain
"Gabriele G. Ponti" <ggponti.at.hotmail.com> wrote in message
news:utBSy0KUEHA.2564@TK2MSFTNGP11.phx.gbl...
> Do you mean a constant?
>
> See the example here:
>
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemCodeDomCodeMemberFieldClassTopic.asp
>
>