diff --git a/WinFormsLibrary1/WinFormsLibrary1/ListBox.cs b/WinFormsLibrary1/WinFormsLibrary1/ListBox.cs index 715c98a..dc905e4 100644 --- a/WinFormsLibrary1/WinFormsLibrary1/ListBox.cs +++ b/WinFormsLibrary1/WinFormsLibrary1/ListBox.cs @@ -25,10 +25,12 @@ namespace WinFormsLibrary1 listBox.SelectedIndex = value; } } + public ListBoxUserControl() { InitializeComponent(); } + public void SetParams(string template, char? fromChar, char? toChar) { _template = template; @@ -49,7 +51,7 @@ namespace WinFormsLibrary1 var curObject = new T(); string text = listBox.SelectedItem?.ToString() ?? ""; - var words = System.Text.RegularExpressions.Regex.Split(_template, $@"\{_startSymbol.Value}.*?\{_endSymbol.Value}"); + var words = Regex.Split(_template, $@"\{_startSymbol.Value}.*?\{_endSymbol.Value}"); int firstWordStart = text.IndexOf(words[0], 0); if (firstWordStart == -1)