示例#1
0
 /// <summary>
 /// Creates a new <see cref="FontStyle"/> instance.
 /// </summary>
 /// <param name="flags">The style flags information applied to text.</param>
 /// <returns>The new instance of the <see cref="FontStyle"/> class.</returns>
 public static FontStyle Create(FontStyleFlags flags = FontStyleFlags.Regular)
 {
     return(new FontStyle()
     {
         Flags = flags
     });
 }
示例#2
0
        private FontStyles FontStyleFlagsToFontStyles(FontStyleFlags flags)
        {
            var result = FontStyles.Normal;

            if ((flags & FontStyleFlags.Bold) != 0)
            {
                result |= FontStyles.Bold;
            }
            if ((flags & FontStyleFlags.Italic) != 0)
            {
                result |= FontStyles.Italic;
            }
            if ((flags & FontStyleFlags.Underline) != 0)
            {
                result |= FontStyles.Underline;
            }
            if ((flags & FontStyleFlags.Strikethrough) != 0)
            {
                result |= FontStyles.Strikethrough;
            }

            return(result);
        }
示例#3
0
 /// <summary>
 /// Creates a new <see cref="FontStyle"/> instance.
 /// </summary>
 /// <param name="flags">The style flags information applied to text.</param>
 /// <returns>The new instance of the <see cref="FontStyle"/> class.</returns>
 public static FontStyle Create(FontStyleFlags flags = FontStyleFlags.Regular)
 {
     return new FontStyle()
     {
         Flags = flags
     };
 }