#include "stdafx.h"
using namespace System;
[ Flags ]
enum class FontFormat
{
None = 0,
BOLD = 1,
ITALIC = 2, // in binary, each represents one bit position
UNDERLINE = 4,
STRIKETHROUGH = 8,
RED = 16,
FLASHING = 32,
BOLD_ITALIC = BOLD | ITALIC // combination of two values
};
ref class Font
{
public:
property String^ Name;
Font(String^ s) { Name = s; }
};
static void SetFont(Font^ font, FontFormat format)
{
if (safe_cast(format) & safe_cast(FontFormat::BOLD))
{
}
if (safe_cast(format) & safe_cast(FontFormat::ITALIC))
{
}
};
int main()
{
SetFont(gcnew Font("Times New Roman"),FontFormat::BOLD | FontFormat::RED );
}