Well Done

This commit is contained in:
2026-03-20 19:26:33 +02:00
parent f123690cb4
commit ac183f8eb6
9 changed files with 231 additions and 70 deletions

View File

@@ -8,26 +8,31 @@ public class WeatherModule : IModule
public string[] GetCommands() => new[] { "Погода", "Пинг" };
public object Execute(string command, object[] args)
public void Settings(object[] args)
{
// args[0] — это родительское окно из Ядра
var parentWindow = args != null && args.Length > 0 ? args[0] as Window : null;
var win = new Window
{
Title = "Окно Погоды",
Content = new WeatherView(), // Вставляем наш контрол
Width = 350,
Height = 250,
WindowStartupLocation = WindowStartupLocation.CenterOwner
};
if (parentWindow != null) win.Show(parentWindow);
else win.Show();
}
public object Execute(string command)
{
switch (command)
{
case "Погода":
// args[0] — это родительское окно из Ядра
var parentWindow = args != null && args.Length > 0 ? args[0] as Window : null;
var win = new Window
{
Title = "Окно Погоды",
Content = new WeatherView(), // Вставляем наш контрол
Width = 350,
Height = 250,
WindowStartupLocation = WindowStartupLocation.CenterOwner
};
if (parentWindow != null) win.Show(parentWindow);
else win.Show();
return "Окно открыто успешно";
case "Пинг":