From f123690cb4cfea9bed069d50b1cf26ef54ced68e Mon Sep 17 00:00:00 2001 From: Egor Date: Thu, 19 Mar 2026 14:24:32 +0200 Subject: [PATCH] Module Archeticture --- ModuleWeather/Module.cs | 6 +++--- VisionAsist/Models/Core.cs | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ModuleWeather/Module.cs b/ModuleWeather/Module.cs index 00c6533..430ebef 100644 --- a/ModuleWeather/Module.cs +++ b/ModuleWeather/Module.cs @@ -6,13 +6,13 @@ public class WeatherModule : IModule { public string Name => "Прогноз Погоды"; - public string[] GetCommands() => new[] { "ShowWeather", "Ping" }; + public string[] GetCommands() => new[] { "Погода", "Пинг" }; public object Execute(string command, object[] args) { switch (command) { - case "ShowWeather": + case "Погода": // args[0] — это родительское окно из Ядра var parentWindow = args != null && args.Length > 0 ? args[0] as Window : null; @@ -30,7 +30,7 @@ public class WeatherModule : IModule return "Окно открыто успешно"; - case "Ping": + case "Пинг": return "Pong! Модуль погоды активен."; default: diff --git a/VisionAsist/Models/Core.cs b/VisionAsist/Models/Core.cs index abc5c35..c0732ae 100644 --- a/VisionAsist/Models/Core.cs +++ b/VisionAsist/Models/Core.cs @@ -35,8 +35,11 @@ public class Core if (type != null) { var module = (IModule)Activator.CreateInstance(type)!; - Core._loadedModules.Add(module.Name, module); - + _loadedModules.Add(module.Name, module); + foreach (var cmd in module.GetCommands()) + { + Console.WriteLine($"- {cmd}"); + } }