mirror of
https://github.com/Stone-Red-Code/DesktopMagic.git
synced 2026-09-04 23:39:29 +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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user