From 2cc96ff67c7e4665b2ba9f64768b6c05eb64f002 Mon Sep 17 00:00:00 2001 From: Lev Rusanov <30170278+JDM170@users.noreply.github.com> Date: Fri, 10 Oct 2025 22:03:02 +0700 Subject: [PATCH] Add drag'n'drop to executable Signed-off-by: Lev Rusanov <30170278+JDM170@users.noreply.github.com> --- Program.cs | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/Program.cs b/Program.cs index b3b80dc..2507803 100644 --- a/Program.cs +++ b/Program.cs @@ -42,8 +42,31 @@ namespace EpisodeRenamer } } - static async Task Main() + static async Task Main(string[] args) { + if (args.Length > 0) + { + try + { + LoadConfiguration(); + } + catch (Exception ex) + { + Console.WriteLine($"Ошибка загрузки конфигурации: {ex.Message}"); + Console.WriteLine("Программа будет завершена."); + Console.ReadLine(); + return; + } + foreach (string line in args) + if (Directory.Exists(line)) + { + ProcessFolder(line); + Console.WriteLine(); + } + Console.ReadLine(); + return; + } + // Создаем экземпляр слушателя using (var hotkeyListener = new HotkeyListener()) {