/// <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 }); }
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); }
/// <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 }; }