mirror of
https://github.com/Stone-Red-Code/DesktopMagic.git
synced 2026-09-04 17:06:12 +02:00
Plugin development QoL improvements
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DesktopMagicPluginAPI.Inputs
|
||||
{
|
||||
public class Button : Element
|
||||
{
|
||||
public event Action OnClick;
|
||||
|
||||
private string _value;
|
||||
|
||||
public string Value
|
||||
{
|
||||
get => _value;
|
||||
set
|
||||
{
|
||||
if (_value != value)
|
||||
{
|
||||
_value = value;
|
||||
ValueChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Button(string value)
|
||||
{
|
||||
Value = value;
|
||||
}
|
||||
|
||||
public void Click()
|
||||
{
|
||||
OnClick?.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ namespace DesktopMagicPluginAPI.Inputs
|
||||
public string Name { get; }
|
||||
public int OrderIndex { get; }
|
||||
|
||||
public ElementAttribute(string name, int orderIndex = 0)
|
||||
public ElementAttribute(string name = "", int orderIndex = 0)
|
||||
{
|
||||
Name = name;
|
||||
OrderIndex = orderIndex;
|
||||
|
||||
+5
-2
@@ -1,6 +1,6 @@
|
||||
namespace DesktopMagicPluginAPI.Inputs
|
||||
{
|
||||
public class Heading : Element
|
||||
public class Label : Element
|
||||
{
|
||||
private string _value;
|
||||
|
||||
@@ -17,9 +17,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
public Heading(string value)
|
||||
public bool Bold { get; set; }
|
||||
|
||||
public Label(string value, bool bold = false)
|
||||
{
|
||||
Value = value;
|
||||
Bold = bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1
-1
@@ -1 +1 @@
|
||||
3d351e819578d1d8c8cf3fc4ddef05ac96911424
|
||||
ced4ac85c0c7d0fe87e126147d10f5c33d432ea7
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1
-1
@@ -1 +1 @@
|
||||
78b084028688b20b372609aac30267390d5f6d25
|
||||
801158c4d5ba4b4a8b0e6e57ad9e67f56077c71a
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user