2021-07-17 02:37:09 +02:00
|
|
|
|
using System;
|
2021-02-17 09:39:31 -03:00
|
|
|
|
using Robust.Client.UserInterface.CustomControls;
|
|
|
|
|
|
using Robust.Shared.IoC;
|
|
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
|
namespace Content.Client.Administration.UI.CustomControls
|
2021-02-17 09:39:31 -03:00
|
|
|
|
{
|
2022-02-16 00:23:23 -07:00
|
|
|
|
public sealed class UICommandButton : CommandButton
|
2021-02-17 09:39:31 -03:00
|
|
|
|
{
|
|
|
|
|
|
public Type? WindowType { get; set; }
|
2022-01-21 01:38:35 -08:00
|
|
|
|
private DefaultWindow? _window;
|
2021-02-17 09:39:31 -03:00
|
|
|
|
|
|
|
|
|
|
protected override void Execute(ButtonEventArgs obj)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (WindowType == null)
|
|
|
|
|
|
return;
|
2022-01-21 01:38:35 -08:00
|
|
|
|
_window = (DefaultWindow) IoCManager.Resolve<IDynamicTypeFactory>().CreateInstance(WindowType);
|
2021-02-17 09:39:31 -03:00
|
|
|
|
_window?.OpenCentered();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|