/// <summary>Begin a span of text in the specified <paramref name="style" /> .</summary> /// <param name="output">Output destination.</param> /// <param name="style">Style to apply.</param> private void Set(RichTextBox output, RichTextThemeStyle style) { if (output is null) { throw new ArgumentNullException(nameof(output)); } if (!this.styles.TryGetValue(style, out var wcts)) { return; } if (wcts.Foreground.HasValue) { output.SelectionColor = wcts.Foreground.Value; } if (wcts.Background.HasValue) { output.SelectionBackColor = wcts.Background.Value; } }
internal StyleReset Apply(RichTextBox output, RichTextThemeStyle style) { this.Set(output, style); return(new StyleReset(output)); }