VB, . , , . , - :
enum Format
{
Bold = 1,
Italic = 2,
Underlined = 4
}
Then you can specify Formathow:
Format format = Format.Bold | Format.Italic;
// Then a check to see if the format is bold or italic should both pass.
Now it is both bold and italic (equal to 3). However, you cannot set this without the flags attribute. This prevents the exclusion of options that exclude mutual exclusion. To do this without flags, you will need to:
enum Format
{
Bold,
BoldUnderlined,
BoldItalic,
BoldUnderlinedItalic,
Underlined,
Italic,
ItalicUnderlined
}
Not as good as nice.
source
share