From 86ac64ad42eb7de0f4fe15f06b52e93c34af3ef5 Mon Sep 17 00:00:00 2001 From: DyCTaTOR <125912249+DyCTaTOR@users.noreply.github.com> Date: Tue, 15 Oct 2024 10:29:10 +0400 Subject: [PATCH] =?UTF-8?q?lab1=20-=20=D1=81=D0=B4=D0=B0=D0=BD=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WinFormsLibrary1/WinFormsLibrary1/ListBox.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)