473,385 Members | 1,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

enum use in CodeDOM?

[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
Nov 16 '05 #1
2 3829

"Martijn Hoogendoorn" <ma*****************@macaw.nl> wrote in message
news:q0****************************@40tude.net...
[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

Nov 16 '05 #2
On Wed, 25 Aug 2004 14:29:40 -0500, Daniel O'Connell [C# MVP] wrote:
"Martijn Hoogendoorn" <ma*****************@macaw.nl> wrote in message
news:q0****************************@40tude.net...
[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!
Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ron Bullman | last post by:
Hi, I havent been able to find any documentation about @ in the CodeDom context. The problem is when generating C# code from CodeDom it will associate a @-tag with all C# specific types. Why?...
1
by: Jax | last post by:
All I can manage is public enum myEnumName The only place where implementation seems to fit in a type declaration is in the Members property Only problem is that the IsEnum switch seems to...
2
by: Guillaume | last post by:
I don't think I'm the only one with this challenge so… I made code with the CodeDom classes and made code to create a new solution and a new project Now I want to get the codedom code in the new...
1
by: John Livermore | last post by:
Hello, We have an application that uses CodeDom for dynamic in-memory compilation of code. The same code (library) is used by both an ASP.net web site and a Windows Service. The code runs fine...
9
by: lee.chappers | last post by:
How can I make the CodeDom generate the following C# method? protected sealed override void Test() { } I've tried using: domMethod.Attributes = MemberAttributes.Override |...
1
by: Tom Jones | last post by:
I am attempting to consume a web service with an enum parameter and not sure how to set a value for it. It looks as follows: public enum SrcTypeEnum { WEB, MAINFRAME,
6
by: bsma1 | last post by:
I building a web service that has an enum I want the consuming application to be able to use. I have the enum declared in the web service as: public enum myEnum { ONE = 1, TWO = 2, };
4
by: mitdej | last post by:
Hi there, I have an several enum types that starts from a nunmber other than 0. For example: public enum InternalStatus { Pending = 1, Ported = 2, Suspended = 3 } I put this values in a int...
2
by: fahad77 | last post by:
I created a class out of .xsd. Now I am generating a new xml file and trying to add "Notice" as an element with an attribute of Index="001". I'm trying to get to value XmlEnumAttribute("0001"). This...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.