- Add MouseButton enum to plugin API to determine which mouse button was pressed

- Add some missing documentation
This commit is contained in:
Stone-Red-Code
2021-09-11 14:24:27 +02:00
parent 535062e8c4
commit 36e09acd0e
8 changed files with 145 additions and 59 deletions
@@ -4,19 +4,23 @@
<TargetFramework>net5.0</TargetFramework>
<Company>Stone_Red</Company>
<Product>Stone_Red</Product>
<Version>0.0.0.2</Version>
<Version>0.0.0.4</Version>
<RepositoryUrl>https://github.com/Stone-Red-Code/DesktopMagic</RepositoryUrl>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<AssemblyVersion>0.0.0.2</AssemblyVersion>
<AssemblyVersion>0.0.0.4</AssemblyVersion>
<PackageProjectUrl></PackageProjectUrl>
<FileVersion>0.0.0.2</FileVersion>
<FileVersion>0.0.0.4</FileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>C:\Users\David\Programmieren\DesktopMagic\src\DesktopMagicPluginAPI\DesktopMagicPluginAPI.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>C:\Users\David\Programmieren\DesktopMagic\src\DesktopMagicPluginAPI\DesktopMagicPluginAPI.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Drawing.Common" Version="5.0.2" />
<PackageReference Include="Vsxmd" Version="1.4.5">
@@ -38,11 +38,15 @@
- [#ctor(value,bold)](#M-DesktopMagicPluginAPI-Inputs-Label-#ctor-System-String,System-Boolean- 'DesktopMagicPluginAPI.Inputs.Label.#ctor(System.String,System.Boolean)')
- [Bold](#P-DesktopMagicPluginAPI-Inputs-Label-Bold 'DesktopMagicPluginAPI.Inputs.Label.Bold')
- [Value](#P-DesktopMagicPluginAPI-Inputs-Label-Value 'DesktopMagicPluginAPI.Inputs.Label.Value')
- [MouseButton](#T-DesktopMagicPluginAPI-Inputs-MouseButton 'DesktopMagicPluginAPI.Inputs.MouseButton')
- [Left](#F-DesktopMagicPluginAPI-Inputs-MouseButton-Left 'DesktopMagicPluginAPI.Inputs.MouseButton.Left')
- [Middle](#F-DesktopMagicPluginAPI-Inputs-MouseButton-Middle 'DesktopMagicPluginAPI.Inputs.MouseButton.Middle')
- [Right](#F-DesktopMagicPluginAPI-Inputs-MouseButton-Right 'DesktopMagicPluginAPI.Inputs.MouseButton.Right')
- [Plugin](#T-DesktopMagicPluginAPI-Plugin 'DesktopMagicPluginAPI.Plugin')
- [Application](#P-DesktopMagicPluginAPI-Plugin-Application 'DesktopMagicPluginAPI.Plugin.Application')
- [UpdateInterval](#P-DesktopMagicPluginAPI-Plugin-UpdateInterval 'DesktopMagicPluginAPI.Plugin.UpdateInterval')
- [Main()](#M-DesktopMagicPluginAPI-Plugin-Main 'DesktopMagicPluginAPI.Plugin.Main')
- [OnMouseClick(position)](#M-DesktopMagicPluginAPI-Plugin-OnMouseClick-System-Drawing-Point- 'DesktopMagicPluginAPI.Plugin.OnMouseClick(System.Drawing.Point)')
- [OnMouseClick(position,mouseButton)](#M-DesktopMagicPluginAPI-Plugin-OnMouseClick-System-Drawing-Point,DesktopMagicPluginAPI-Inputs-MouseButton- 'DesktopMagicPluginAPI.Plugin.OnMouseClick(System.Drawing.Point,DesktopMagicPluginAPI.Inputs.MouseButton)')
- [OnMouseMove(position)](#M-DesktopMagicPluginAPI-Plugin-OnMouseMove-System-Drawing-Point- 'DesktopMagicPluginAPI.Plugin.OnMouseMove(System.Drawing.Point)')
- [Start()](#M-DesktopMagicPluginAPI-Plugin-Start 'DesktopMagicPluginAPI.Plugin.Start')
- [Slider](#T-DesktopMagicPluginAPI-Inputs-Slider 'DesktopMagicPluginAPI.Inputs.Slider')
@@ -325,14 +329,14 @@ Gets the font of the main application.
##### Summary
Gets the window position of the main application.
Gets the window position of the plugin window.
<a name='P-DesktopMagicPluginAPI-IPluginData-WindowSize'></a>
### WindowSize `property`
##### Summary
Gets the window size of the main application.
Gets the window size of the plugin window.
<a name='M-DesktopMagicPluginAPI-IPluginData-UpdateWindow'></a>
### UpdateWindow() `method`
@@ -437,6 +441,38 @@ Gets or set a value indicating whether the content of the [Label](#T-DesktopMagi
Gets or sets the text associated with this [Label](#T-DesktopMagicPluginAPI-Inputs-Label 'DesktopMagicPluginAPI.Inputs.Label').
<a name='T-DesktopMagicPluginAPI-Inputs-MouseButton'></a>
## MouseButton `type`
##### Namespace
DesktopMagicPluginAPI.Inputs
##### Summary
Mouse Buttons
<a name='F-DesktopMagicPluginAPI-Inputs-MouseButton-Left'></a>
### Left `constants`
##### Summary
The left mouse button.
<a name='F-DesktopMagicPluginAPI-Inputs-MouseButton-Middle'></a>
### Middle `constants`
##### Summary
The middle mouse button.
<a name='F-DesktopMagicPluginAPI-Inputs-MouseButton-Right'></a>
### Right `constants`
##### Summary
The right mouse button.
<a name='T-DesktopMagicPluginAPI-Plugin'></a>
## Plugin `type`
@@ -477,8 +513,8 @@ Occurs when the [UpdateInterval](#P-DesktopMagicPluginAPI-Plugin-UpdateInterval
This method has no parameters.
<a name='M-DesktopMagicPluginAPI-Plugin-OnMouseClick-System-Drawing-Point-'></a>
### OnMouseClick(position) `method`
<a name='M-DesktopMagicPluginAPI-Plugin-OnMouseClick-System-Drawing-Point,DesktopMagicPluginAPI-Inputs-MouseButton-'></a>
### OnMouseClick(position,mouseButton) `method`
##### Summary
@@ -488,7 +524,8 @@ Occurs when the window is clicked by the mouse.
| Name | Type | Description |
| ---- | ---- | ----------- |
| position | [System.Drawing.Point](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Point 'System.Drawing.Point') | |
| position | [System.Drawing.Point](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Point 'System.Drawing.Point') | The x- and y-coordinates of the mouse pointer position relative to the plugin window. |
| mouseButton | [DesktopMagicPluginAPI.Inputs.MouseButton](#T-DesktopMagicPluginAPI-Inputs-MouseButton 'DesktopMagicPluginAPI.Inputs.MouseButton') | Gets the button associated with the event. |
<a name='M-DesktopMagicPluginAPI-Plugin-OnMouseMove-System-Drawing-Point-'></a>
### OnMouseMove(position) `method`
@@ -501,7 +538,7 @@ Occurs when the mouse pointer is moved over the control.
| Name | Type | Description |
| ---- | ---- | ----------- |
| position | [System.Drawing.Point](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Point 'System.Drawing.Point') | |
| position | [System.Drawing.Point](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Point 'System.Drawing.Point') | The x- and y-coordinates of the mouse pointer position relative to the plugin window. |
<a name='M-DesktopMagicPluginAPI-Plugin-Start'></a>
### Start() `method`
@@ -192,6 +192,26 @@
<param name="value">The text associated with this <see cref="T:DesktopMagicPluginAPI.Inputs.Label"/></param>
<param name="bold">A value indicating whether the content of the <see cref="T:DesktopMagicPluginAPI.Inputs.Label"/> is bold or not.</param>
</member>
<member name="T:DesktopMagicPluginAPI.Inputs.MouseButton">
<summary>
Mouse Buttons
</summary>
</member>
<member name="F:DesktopMagicPluginAPI.Inputs.MouseButton.Left">
<summary>
The left mouse button.
</summary>
</member>
<member name="F:DesktopMagicPluginAPI.Inputs.MouseButton.Middle">
<summary>
The middle mouse button.
</summary>
</member>
<member name="F:DesktopMagicPluginAPI.Inputs.MouseButton.Right">
<summary>
The right mouse button.
</summary>
</member>
<member name="T:DesktopMagicPluginAPI.Inputs.Slider">
<summary>
Represents a slider control.
@@ -253,12 +273,12 @@
</member>
<member name="P:DesktopMagicPluginAPI.IPluginData.WindowSize">
<summary>
Gets the window size of the main application.
Gets the window size of the plugin window.
</summary>
</member>
<member name="P:DesktopMagicPluginAPI.IPluginData.WindowPosition">
<summary>
Gets the window position of the main application.
Gets the window position of the plugin window.
</summary>
</member>
<member name="M:DesktopMagicPluginAPI.IPluginData.UpdateWindow">
@@ -292,17 +312,18 @@
</summary>
<returns></returns>
</member>
<member name="M:DesktopMagicPluginAPI.Plugin.OnMouseClick(System.Drawing.Point)">
<member name="M:DesktopMagicPluginAPI.Plugin.OnMouseClick(System.Drawing.Point,DesktopMagicPluginAPI.Inputs.MouseButton)">
<summary>
Occurs when the window is clicked by the mouse.
</summary>
<param name="position"></param>
<param name="position">The x- and y-coordinates of the mouse pointer position relative to the plugin window.</param>
<param name="mouseButton">Gets the button associated with the event.</param>
</member>
<member name="M:DesktopMagicPluginAPI.Plugin.OnMouseMove(System.Drawing.Point)">
<summary>
Occurs when the mouse pointer is moved over the control.
</summary>
<param name="position"></param>
<param name="position">The x- and y-coordinates of the mouse pointer position relative to the plugin window.</param>
</member>
</members>
</doc>
+2 -2
View File
@@ -18,12 +18,12 @@ namespace DesktopMagicPluginAPI
Color Color { get; }
/// <summary>
/// Gets the window size of the main application.
/// Gets the window size of the plugin window.
/// </summary>
Point WindowSize { get; }
/// <summary>
/// Gets the window position of the main application.
/// Gets the window position of the plugin window.
/// </summary>
Point WindowPosition { get; }
@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DesktopMagicPluginAPI.Inputs
{
/// <summary>
/// Mouse Buttons
/// </summary>
public enum MouseButton
{
/// <summary>
/// The left mouse button.
/// </summary>
Left,
/// <summary>
/// The middle mouse button.
/// </summary>
Middle,
/// <summary>
/// The right mouse button.
/// </summary>
Right,
}
}
+6 -4
View File
@@ -1,4 +1,5 @@
using System;
using DesktopMagicPluginAPI.Inputs;
using System;
using System.Drawing;
namespace DesktopMagicPluginAPI
@@ -50,15 +51,16 @@ namespace DesktopMagicPluginAPI
/// <summary>
/// Occurs when the window is clicked by the mouse.
/// </summary>
/// <param name="position"></param>
public virtual void OnMouseClick(Point position)
/// <param name="position">The x- and y-coordinates of the mouse pointer position relative to the plugin window.</param>
/// <param name="mouseButton">Gets the button associated with the event.</param>
public virtual void OnMouseClick(Point position, MouseButton mouseButton)
{
}
/// <summary>
/// Occurs when the mouse pointer is moved over the control.
/// </summary>
/// <param name="position"></param>
/// <param name="position">The x- and y-coordinates of the mouse pointer position relative to the plugin window.</param>
public virtual void OnMouseMove(Point position)
{
}