enum use in CodeDOM?

  • Thread starter Thread starter Martijn Hoogendoorn
  • Start date Start date
M

Martijn Hoogendoorn

[Flags]
public enum myEnum
{
a,
b,
c,
d,
e,
}

myEnum c = myEnum.a | myEnum.b | myEnum.c | myEnum.e | ...;

I want to generate the line above, is there any way to do this (language
independent ofcourse)

Thanks!

Martijn
 
Martijn Hoogendoorn said:
[Flags]
public enum myEnum
{
a,
b,
c,
d,
e,
}

myEnum c = myEnum.a | myEnum.b | myEnum.c | myEnum.e | ...;

I want to generate the line above, is there any way to do this (language
independent ofcourse)

Look at CodeBinaryOperatorExpression. It allows you to specify underlying
expressions and an operator.

To chain like that you should be able to simply pass a
CodeBinaryOperatorExpression as one of the expressions in the next
CodeBinaryOperatorExpression.
 
Martijn Hoogendoorn said:
[Flags]
public enum myEnum
{
a,
b,
c,
d,
e,
}

myEnum c = myEnum.a | myEnum.b | myEnum.c | myEnum.e | ...;

I want to generate the line above, is there any way to do this (language
independent ofcourse)

Look at CodeBinaryOperatorExpression. It allows you to specify underlying
expressions and an operator.

To chain like that you should be able to simply pass a
CodeBinaryOperatorExpression as one of the expressions in the next
CodeBinaryOperatorExpression.
Thanks!

Martijn

Works like a charm now, thanks for your help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top