Plugin development QoL improvements

This commit is contained in:
Stone-Red-Code
2021-07-19 19:22:11 +02:00
parent 985a68b33e
commit 83a6339a46
56 changed files with 119 additions and 31 deletions
@@ -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;
@@ -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;
}
}
}
@@ -1 +1 @@
3d351e819578d1d8c8cf3fc4ddef05ac96911424
ced4ac85c0c7d0fe87e126147d10f5c33d432ea7
@@ -1 +1 @@
78b084028688b20b372609aac30267390d5f6d25
801158c4d5ba4b4a8b0e6e57ad9e67f56077c71a