From 4b47f9686dc908bec4f2b298c5cfac34e0deae3b Mon Sep 17 00:00:00 2001 From: GabCard Date: Thu, 31 Oct 2019 14:27:46 +0100 Subject: [PATCH 1/2] Add ForceUpperCase property Force inserted string or char to be upper case --- FastColoredTextBox/FastColoredTextBox.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/FastColoredTextBox/FastColoredTextBox.cs b/FastColoredTextBox/FastColoredTextBox.cs index 1478374f..f618bf99 100644 --- a/FastColoredTextBox/FastColoredTextBox.cs +++ b/FastColoredTextBox/FastColoredTextBox.cs @@ -233,6 +233,13 @@ public char[] AutoCompleteBracketsList [Description("AutoComplete brackets.")] public bool AutoCompleteBrackets { get; set; } + /// + /// AutoComplete brackets + /// + [DefaultValue(false)] + [Description("Force upper case.")] + public bool ForceUpperCase { get; set; } + /// /// Colors of some service visual markers /// @@ -2729,7 +2736,7 @@ public virtual void InsertText(string text, bool jumpToCaret) if (Selection.IsEmpty && Selection.Start.iChar > GetLineLength(Selection.Start.iLine) && VirtualSpace) InsertVirtualSpaces(); - lines.Manager.ExecuteCommand(new InsertTextCommand(TextSource, text)); + lines.Manager.ExecuteCommand(new InsertTextCommand(TextSource, ForceUpperCase ? text.ToUpper() : text)); if (updating <= 0 && jumpToCaret) DoCaretVisible(); } @@ -2988,7 +2995,7 @@ protected virtual void InsertChar(char c) InsertVirtualSpaces(); //insert char - lines.Manager.ExecuteCommand(new InsertCharCommand(TextSource, c)); + lines.Manager.ExecuteCommand(new InsertCharCommand(TextSource, ForceUpperCase ? char.ToUpper(c) : c)); } finally { From a7cf362081433f047cd46b06be2f416921bbed6d Mon Sep 17 00:00:00 2001 From: GabCard Date: Thu, 16 Jan 2020 15:53:38 +0100 Subject: [PATCH 2/2] Update summary --- FastColoredTextBox/FastColoredTextBox.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FastColoredTextBox/FastColoredTextBox.cs b/FastColoredTextBox/FastColoredTextBox.cs index f618bf99..38d4b24d 100644 --- a/FastColoredTextBox/FastColoredTextBox.cs +++ b/FastColoredTextBox/FastColoredTextBox.cs @@ -234,7 +234,7 @@ public char[] AutoCompleteBracketsList public bool AutoCompleteBrackets { get; set; } /// - /// AutoComplete brackets + /// Force inserted string or char to be uppercase /// [DefaultValue(false)] [Description("Force upper case.")]