A comment has been added into the NikseComboBox control to improve code readability. This comment details the conditions under which the selected index is updated, specifically when a new value is present and distinct from the previous selection within the '_items' list.
The 'Text' and 'SelectedText' properties of 'NikseComboBox' have been refactored for a cleaner approach. This involved creating helper methods such as 'GetValue', 'HasValueChanged', and 'NotifyTextChanged' to reduce redundancy and improve readability. These changes consolidate the process of getting or setting text, and notifying on these changes.
The event invocation code in MessageHandlerWindow.cs file specifically for OnCopyData has been updated. Instead of creating a new instance of EventArgs, the code now uses the static EventArgs.Empty instance, which is more efficient and adheres to common C# best practices.
The System.Threading and System.Threading.Tasks namespaces were included in the AdvancedTextBox.cs file but were not being used. Their inclusion has been removed to clean up the code and improve readability.
The underlying TextBox in NikseComboBox has been refactored to InnerTextBox. This change enables handling of the right-click event directly within the InnerTextBox class, eliminating the need to set context menus for both classes individually. It improves the encapsulation of event handling within the control itself.
This change introduces the ContextMenuStrip property to the NikseComboBox control. The added property ensures that once the ContextMenuStrip is set for the combobox control, it's also set for the underlying textbox. This is important for maintaining consistent behavior in both the combobox and its textbox.
Introduced a new interface, ISelectedText, to make handling of text selection more uniform across different control types. Applied the interface to TextBox, NikseTextBox, NikseComboBox, and SETextBox. This decouples text-selection-related code from the actual visual control. Further, optimized the code to update context menus in various forms. Now, regex context menus are only assigned when regex options are selected, reducing unnecessary assignments and simplifying the code.
Changed input parameter to a local variable 'text' while calling FixOcrErrorViaLineReplaceList method in FixCommonOcrLineErrors. This improves the accuracy of OCR correction by ensuring the original text is not repeatedly used instead of the corrected version.
The variable 'post' within the method 'FixDoubleGreaterThanHelper' has been renamed to 'pre'. This change is made to better align the variable name with its actual use within the method, as it prepares (or prefixes) content before processing the 'text' input.