Skip to content

Commit eadc24d

Browse files
committed
Rename WebUtils to DictionaryClient for better clarity.
Renamed the WebUtils class and its references to DictionaryClient to better represent its role in handling dictionary-related HTTP operations. This change improves code readability and aligns naming with its functionality.
1 parent 4969ad3 commit eadc24d

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

source/DictionariesProvider/Forms/Main.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace Nikse.SubtitleEdit.PluginLogic.Forms
1616
public partial class Main : Form
1717
{
1818
private const string SettingFile = "DictionariesProvider.json";
19-
private WebUtils _webUtils;
19+
private DictionaryClient _dictionaryClient;
2020

2121
private List<DictionaryInfo> DictionariesInfo { get; set; }
2222

@@ -58,7 +58,7 @@ public Main()
5858
{
5959
comboBoxDownloadLinks.Text = comboBoxDownloadLinks.SelectedText;
6060
};
61-
_webUtils = new WebUtils(new System.Net.Http.HttpClient());
61+
_dictionaryClient = new DictionaryClient(new System.Net.Http.HttpClient());
6262
}
6363

6464
private void LoadConfigs()
@@ -176,7 +176,7 @@ private async void ButtonDownload_Click(object sender, EventArgs e)
176176

177177
var downloadUrls = listViewDownloadUrls.SelectedItems.Cast<ListViewItem>().Select(lvi => lvi.Text);
178178
// parallel asnc download
179-
await Task.WhenAll(downloadUrls.Select(url => _webUtils.Download(url)));
179+
await Task.WhenAll(downloadUrls.Select(url => _dictionaryClient.Download(url)));
180180

181181
Cursor = Cursors.Default;
182182
MessageBox.Show("Download completed");
@@ -203,7 +203,7 @@ private void ImportFormXMLToolStripMenuItem_Click(object sender, EventArgs e)
203203
Description = el.Element("Description")?.Value,
204204
DownloadLinks = new List<DownloadLink>
205205
{
206-
new DownloadLink
206+
new()
207207
{
208208
Url = new Uri(el.Element("DownloadLink").Value),
209209
Status = true
@@ -220,7 +220,7 @@ private async void ButtonUpdateStatus_Click(object sender, EventArgs e)
220220
{
221221
buttonUpdateStatus.Enabled = false;
222222
//await System.Threading.Tasks.Task.Yield();
223-
await _webUtils.UpdateStateAsync(DictionariesInfo.SelectMany(di => di.DownloadLinks)); //.ConfigureAwait(true);
223+
await _dictionaryClient.UpdateStateAsync(DictionariesInfo.SelectMany(di => di.DownloadLinks)); //.ConfigureAwait(true);
224224
buttonUpdateStatus.Enabled = true;
225225
}
226226
}

source/DictionariesProvider/Helpers/WebUtils.cs renamed to source/DictionariesProvider/Helpers/DictionaryClient.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313

1414
namespace Nikse.SubtitleEdit.PluginLogic.Helpers
1515
{
16-
public class WebUtils : IDisposable
16+
public class DictionaryClient : IDisposable
1717
{
1818
private readonly HttpClient _httpClient;
1919

20-
public WebUtils(HttpClient httpClient)
20+
public DictionaryClient(HttpClient httpClient)
2121
{
2222
_httpClient = httpClient;
2323

0 commit comments

Comments
 (0)