Ejemplo n.º 1
0
        private static EFontDecoration ConvertFontDecoration(CFontDecoration fontDecoration)
        {
            switch (fontDecoration & (CFontDecoration.Underline | CFontDecoration.Strikethrough))
            {
            case CFontDecoration.None:
                return(EFontDecoration.None);

            case CFontDecoration.Underline:
                return(EFontDecoration.Underline);

            case CFontDecoration.Strikethrough:
                return(EFontDecoration.Strikethrough);

            case CFontDecoration.Underline | CFontDecoration.Strikethrough:
                return(EFontDecoration.Underline | EFontDecoration.Strikethrough);

            default:
                throw new ArgumentOutOfRangeException(nameof(fontDecoration));
            }
        }
Ejemplo n.º 2
0
        private static FontStyle ConvertFontStyle(CFontDecoration fontDecoration)
        {
            switch (fontDecoration & (CFontDecoration.Bold | CFontDecoration.Italic))
            {
            case CFontDecoration.None:
                return(FontStyle.None);

            case CFontDecoration.Bold:
                return(FontStyle.Bold);

            case CFontDecoration.Italic:
                return(FontStyle.Italic);

            case CFontDecoration.Bold | CFontDecoration.Italic:
                return(FontStyle.Bold | FontStyle.Italic);

            default:
                throw new ArgumentOutOfRangeException(nameof(fontDecoration));
            }
        }