Refactor step 1

This commit is contained in:
Stone_Red
2023-11-19 16:19:07 +01:00
parent 3eae8bcdfc
commit 74bf7c2fb8
30 changed files with 595 additions and 412 deletions
+1 -14
View File
@@ -1,5 +1,4 @@
using System;
using System.Drawing;
using System.Drawing;
namespace DesktopMagicPluginAPI;
@@ -8,18 +7,6 @@ namespace DesktopMagicPluginAPI;
/// </summary>
public interface IPluginData
{
/// <summary>
/// Gets the current font of the current theme.
/// </summary>
[Obsolete("Use the \"Theme\" property instead")]
string Font { get; }
/// <summary>
/// Gets the current color of the current theme.
/// </summary>
[Obsolete("Use the \"Theme\" property instead")]
Color Color { get; }
/// <summary>
/// Gets the current theme setting of the main application.
/// </summary>
@@ -1,11 +1,11 @@
using System;
namespace DesktopMagicPluginAPI.Inputs;
namespace DesktopMagicPluginAPI.Settings;
/// <summary>
/// Represents a button control.
/// </summary>
public class Button : Element
public class Button : Setting
{
/// <summary>
/// Occurs when the button gets clicked.
@@ -1,9 +1,9 @@
namespace DesktopMagicPluginAPI.Inputs;
namespace DesktopMagicPluginAPI.Settings;
/// <summary>
/// Represents a check box control.
/// </summary>
public class CheckBox : Element
public class CheckBox : Setting
{
private bool _value;
@@ -1,11 +1,13 @@
using System.Collections.ObjectModel;
using DesktopMagicPluginAPI.Inputs;
namespace DesktopMagicPluginAPI.Inputs;
using System.Collections.ObjectModel;
namespace DesktopMagicPluginAPI.Settings;
/// <summary>
/// Represents a selection control with a drop-down list.
/// </summary>
public class ComboBox : Element
public class ComboBox : Setting
{
private string _value;
@@ -1,11 +1,11 @@
using System;
namespace DesktopMagicPluginAPI.Inputs;
namespace DesktopMagicPluginAPI.Settings;
/// <summary>
/// Represents a up-down control.
/// </summary>
public class IntegerUpDown : Element
public class IntegerUpDown : Setting
{
private int _value;
@@ -1,9 +1,11 @@
namespace DesktopMagicPluginAPI.Inputs;
using DesktopMagicPluginAPI.Settings;
namespace DesktopMagicPluginAPI.Inputs;
/// <summary>
/// Represents a label control.
/// </summary>
public class Label : Element
public class Label : Setting
{
private string _value;
@@ -1,11 +1,11 @@
using System;
namespace DesktopMagicPluginAPI.Inputs;
namespace DesktopMagicPluginAPI.Settings;
/// <summary>
/// The element base class.
/// </summary>
public abstract class Element
public abstract class Setting
{
/// <summary>
/// Occurs when the value has been changed.
@@ -6,7 +6,7 @@ namespace DesktopMagicPluginAPI.Inputs;
/// Marks a Property as element.
/// </summary>
[AttributeUsage(AttributeTargets.Field)]
public class ElementAttribute : Attribute
public class SettingAttribute : Attribute
{
/// <summary>
/// The name of the element.
@@ -23,7 +23,7 @@ public class ElementAttribute : Attribute
/// </summary>
/// <param name="name">The name of the element.</param>
/// <param name="orderIndex">The order index of the element.</param>
public ElementAttribute(string name, int orderIndex = 0)
public SettingAttribute(string name, int orderIndex = 0)
{
Name = name;
OrderIndex = orderIndex;
@@ -33,13 +33,13 @@ public class ElementAttribute : Attribute
/// Marks a Property as element with the provided <paramref name="orderIndex"/>.
/// </summary>
/// <param name="orderIndex">The order index of the element.</param>
public ElementAttribute(int orderIndex)
public SettingAttribute(int orderIndex)
{
OrderIndex = orderIndex;
}
/// <inheritdoc cref="ElementAttribute"/>
public ElementAttribute()
/// <inheritdoc cref="SettingAttribute"/>
public SettingAttribute()
{
}
}
@@ -1,11 +1,11 @@
using System;
namespace DesktopMagicPluginAPI.Inputs;
namespace DesktopMagicPluginAPI.Settings;
/// <summary>
/// Represents a slider control.
/// </summary>
public sealed class Slider : Element
public sealed class Slider : Setting
{
private double _value;
@@ -1,9 +1,9 @@
namespace DesktopMagicPluginAPI.Inputs;
namespace DesktopMagicPluginAPI.Settings;
/// <summary>
/// Represents a text box control.
/// </summary>
public class TextBox : Element
public class TextBox : Setting
{
private string _value;