mirror of
https://github.com/Stone-Red-Code/DesktopMagic.git
synced 2026-09-05 23:39:05 +02:00
@@ -1,4 +1,5 @@
|
||||
using DesktopMagicPluginAPI;
|
||||
using DesktopMagicPluginAPI.Inputs;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
@@ -7,17 +8,59 @@ namespace DesktopMagicPlugin.Test
|
||||
{
|
||||
public class PluginScript : Plugin
|
||||
{
|
||||
public override Bitmap Main()
|
||||
[Element]
|
||||
private Label heading = new Label("Heading", true);
|
||||
|
||||
[Element]
|
||||
private Label label = new Label("");
|
||||
|
||||
[Element("Slider:")]
|
||||
private Slider slider = new Slider(1, 23, 4);
|
||||
|
||||
[Element("Text:")]
|
||||
private TextBox textBox = new TextBox("abc");
|
||||
|
||||
[Element]
|
||||
private Button button = new Button("Press me!");
|
||||
|
||||
public override int UpdateInterval { get; set; }
|
||||
|
||||
public PluginScript()
|
||||
{
|
||||
Bitmap bmp = new Bitmap(100, 100);
|
||||
using Graphics g = Graphics.FromImage(bmp);
|
||||
g.Clear(Application.Color);
|
||||
return bmp;
|
||||
slider.OnValueChanged += Slider_OnValueChanged;
|
||||
textBox.OnValueChanged += TextBox_OnValueChanged;
|
||||
button.OnClick += Button_OnClick; ;
|
||||
}
|
||||
|
||||
public override void OnMouseClick(Point position)
|
||||
private void Button_OnClick()
|
||||
{
|
||||
Debug.WriteLine(position);
|
||||
Debug.WriteLine("Button pressed");
|
||||
Application.UpdateWindow();
|
||||
}
|
||||
|
||||
private void TextBox_OnValueChanged()
|
||||
{
|
||||
Debug.WriteLine("TextBox value changed:" + textBox.Value);
|
||||
}
|
||||
|
||||
private void Slider_OnValueChanged()
|
||||
{
|
||||
Debug.WriteLine("Slider value changed:" + slider.Value);
|
||||
}
|
||||
|
||||
public override Bitmap Main()
|
||||
{
|
||||
string str = $"{textBox.Value}: {slider.Value}";
|
||||
|
||||
Bitmap bmp = new Bitmap(1000, 1000);
|
||||
using Graphics g = Graphics.FromImage(bmp);
|
||||
g.Clear(Application.Color);
|
||||
g.DrawString(str, new Font(Application.Font, 100), Brushes.Black, new PointF(0, 0));
|
||||
|
||||
label.Value = str;
|
||||
slider.Value++;
|
||||
|
||||
return bmp;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@
|
||||
".NETCoreApp,Version=v5.0": {
|
||||
"DesktopMagicPlugin.Test/1.0.0": {
|
||||
"dependencies": {
|
||||
"DesktopMagicPluginAPI": "1.0.0",
|
||||
"DesktopMagicPluginAPI": "0.0.0.1",
|
||||
"System.Drawing.Common": "5.0.2"
|
||||
},
|
||||
"runtime": {
|
||||
@@ -60,7 +60,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"DesktopMagicPluginAPI/1.0.0": {
|
||||
"DesktopMagicPluginAPI/0.0.0.1": {
|
||||
"dependencies": {
|
||||
"System.Drawing.Common": "5.0.2"
|
||||
},
|
||||
@@ -97,7 +97,7 @@
|
||||
"path": "system.drawing.common/5.0.2",
|
||||
"hashPath": "system.drawing.common.5.0.2.nupkg.sha512"
|
||||
},
|
||||
"DesktopMagicPluginAPI/1.0.0": {
|
||||
"DesktopMagicPluginAPI/0.0.0.1": {
|
||||
"type": "project",
|
||||
"serviceable": false,
|
||||
"sha512": ""
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1
-1
@@ -1 +1 @@
|
||||
6563cf0e841cae8437271556bdf55cc1001baf45
|
||||
b2d81a1822e345897b3638c6df1a9a5fe1575c17
|
||||
|
||||
+15
@@ -13,3 +13,18 @@ C:\Users\David\Google Drive\Programmieren\DesktopMagic\DesktopMagicPlugin.Test\o
|
||||
C:\Users\David\Google Drive\Programmieren\DesktopMagic\DesktopMagicPlugin.Test\obj\Debug\net5.0\DesktopMagicPlugin.Test.dll
|
||||
C:\Users\David\Google Drive\Programmieren\DesktopMagic\DesktopMagicPlugin.Test\obj\Debug\net5.0\ref\DesktopMagicPlugin.Test.dll
|
||||
C:\Users\David\Google Drive\Programmieren\DesktopMagic\DesktopMagicPlugin.Test\obj\Debug\net5.0\DesktopMagicPlugin.Test.pdb
|
||||
C:\Users\David\Programmieren\DesktopMagic\src\DesktopMagicPlugin.Test\bin\Debug\net5.0\DesktopMagicPlugin.Test.deps.json
|
||||
C:\Users\David\Programmieren\DesktopMagic\src\DesktopMagicPlugin.Test\bin\Debug\net5.0\DesktopMagicPlugin.Test.dll
|
||||
C:\Users\David\Programmieren\DesktopMagic\src\DesktopMagicPlugin.Test\bin\Debug\net5.0\ref\DesktopMagicPlugin.Test.dll
|
||||
C:\Users\David\Programmieren\DesktopMagic\src\DesktopMagicPlugin.Test\bin\Debug\net5.0\DesktopMagicPlugin.Test.pdb
|
||||
C:\Users\David\Programmieren\DesktopMagic\src\DesktopMagicPlugin.Test\bin\Debug\net5.0\DesktopMagicPluginAPI.dll
|
||||
C:\Users\David\Programmieren\DesktopMagic\src\DesktopMagicPlugin.Test\bin\Debug\net5.0\DesktopMagicPluginAPI.pdb
|
||||
C:\Users\David\Programmieren\DesktopMagic\src\DesktopMagicPlugin.Test\obj\Debug\net5.0\DesktopMagicPlugin.Test.csproj.AssemblyReference.cache
|
||||
C:\Users\David\Programmieren\DesktopMagic\src\DesktopMagicPlugin.Test\obj\Debug\net5.0\DesktopMagicPlugin.Test.GeneratedMSBuildEditorConfig.editorconfig
|
||||
C:\Users\David\Programmieren\DesktopMagic\src\DesktopMagicPlugin.Test\obj\Debug\net5.0\DesktopMagicPlugin.Test.AssemblyInfoInputs.cache
|
||||
C:\Users\David\Programmieren\DesktopMagic\src\DesktopMagicPlugin.Test\obj\Debug\net5.0\DesktopMagicPlugin.Test.AssemblyInfo.cs
|
||||
C:\Users\David\Programmieren\DesktopMagic\src\DesktopMagicPlugin.Test\obj\Debug\net5.0\DesktopMagicPlugin.Test.csproj.CoreCompileInputs.cache
|
||||
C:\Users\David\Programmieren\DesktopMagic\src\DesktopMagicPlugin.Test\obj\Debug\net5.0\DesktopMagicPlugin.Test.csproj.CopyComplete
|
||||
C:\Users\David\Programmieren\DesktopMagic\src\DesktopMagicPlugin.Test\obj\Debug\net5.0\DesktopMagicPlugin.Test.dll
|
||||
C:\Users\David\Programmieren\DesktopMagic\src\DesktopMagicPlugin.Test\obj\Debug\net5.0\ref\DesktopMagicPlugin.Test.dll
|
||||
C:\Users\David\Programmieren\DesktopMagic\src\DesktopMagicPlugin.Test\obj\Debug\net5.0\DesktopMagicPlugin.Test.pdb
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -117,6 +117,12 @@
|
||||
"System.Drawing.Common": {
|
||||
"target": "Package",
|
||||
"version": "[5.0.2, )"
|
||||
},
|
||||
"Vsxmd": {
|
||||
"include": "Runtime, Build, Native, ContentFiles, Analyzers, BuildTransitive",
|
||||
"suppressParent": "All",
|
||||
"target": "Package",
|
||||
"version": "[1.4.5, )"
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
|
||||
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"version": 2,
|
||||
"dgSpecHash": "59oKz8iQi2NLQOE/f3WkFPAnSXx6cAU72rhlMV9prQ/FswhPoY55RLjBgMtfdheeydg4va0SJN8wY8GmG+WPZw==",
|
||||
"dgSpecHash": "lft2dd4zl11v1LbmtpK4Y9JZaHJSeCToDvj0karyjgBy5j+xx2bva9cJ8zhwTqa0WKSvhYSpNzvqD0aCulDxaA==",
|
||||
"success": true,
|
||||
"projectFilePath": "C:\\Users\\David\\Programmieren\\DesktopMagic\\src\\DesktopMagicPlugin.Test\\DesktopMagicPlugin.Test.csproj",
|
||||
"expectedPackageFiles": [
|
||||
|
||||
Reference in New Issue
Block a user