Well Done
This commit is contained in:
@@ -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 "Пинг":
|
||||
|
||||
Reference in New Issue
Block a user