#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<int>(format) & safe_cast<int>(FontFormat::BOLD))
{
}
if (safe_cast<int>(format) & safe_cast<int>(FontFormat::ITALIC))
{
}
};
int main()
{
SetFont(gcnew Font("Times New Roman"),FontFormat::BOLD | FontFormat::RED );
}
|