bitwise operators - What is | in C# here? -


in following code block there few bitwise or's. i've never used them before trying understand code block meant.

    document doc = new document("cleanupoptions.docx");     doc.mailmerge.cleanupoptions = mailmergecleanupoptions.removeunusedregions |     mailmergecleanupoptions.removeunusedfields |     mailmergecleanupoptions.removecontainingfields;     doc.mailmerge.executewithregions(dataset); 

so in block above, if used doc.mailmerge.cleanupoptions, how pick of statements cleanupoptions equal to? or combined?

they combined. enum can marked [flagsattribute] allows combination of values:

https://msdn.microsoft.com/en-us/library/system.flagsattribute(v=vs.110).aspx


Comments

Popular posts from this blog

c# - SharpSsh Command Execution -

python - Specify path of savefig with pylab or matplotlib -

How to run C# code using mono without Xamarin in Android? -