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

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -