- Rename src to _src
|
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
@@ -0,0 +1,49 @@
|
||||
; Script generated by the Inno Setup Script Wizard.
|
||||
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
|
||||
|
||||
#define MyAppName "DesktopMagic"
|
||||
#define MyAppVersion "0.0.3.1"
|
||||
#define MyAppPublisher "Stone_Red"
|
||||
#define MyAppExeName "DesktopMagic.exe"
|
||||
|
||||
[Setup]
|
||||
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
|
||||
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
|
||||
AppId={{61FE5CE9-47C3-4255-A1F4-5BCF4ACA0876}
|
||||
AppName={#MyAppName}
|
||||
AppVersion={#MyAppVersion}
|
||||
;AppVerName={#MyAppName} {#MyAppVersion}
|
||||
AppPublisher={#MyAppPublisher}
|
||||
DefaultDirName={autopf}\{#MyAppName}
|
||||
DisableProgramGroupPage=yes
|
||||
; The [Icons] "quicklaunchicon" entry uses {userappdata} but its [Tasks] entry has a proper IsAdminInstallMode Check.
|
||||
UsedUserAreasWarning=no
|
||||
; Remove the following line to run in administrative install mode (install for all users.)
|
||||
PrivilegesRequired=lowest
|
||||
PrivilegesRequiredOverridesAllowed=dialog
|
||||
OutputBaseFilename=DesktopMagic-Installer
|
||||
OutputDir=.
|
||||
Compression=lzma
|
||||
SolidCompression=yes
|
||||
WizardStyle=modern
|
||||
|
||||
[Languages]
|
||||
Name: "english"; MessagesFile: "compiler:Default.isl"
|
||||
Name: "german"; MessagesFile: "compiler:Languages\German.isl"
|
||||
|
||||
[Tasks]
|
||||
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
|
||||
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 6.1; Check: not IsAdminInstallMode
|
||||
|
||||
[Files]
|
||||
Source: "..\DesktopMagic\bin\Release\net5.0-windows\publish\DesktopMagic.exe"; DestDir: "{app}"; Flags: ignoreversion
|
||||
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
|
||||
|
||||
[Icons]
|
||||
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
|
||||
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
|
||||
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon
|
||||
|
||||
[Run]
|
||||
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
|
||||
|
||||
@@ -0,0 +1,146 @@
|
||||
using AlwaysUpToDate;
|
||||
|
||||
using Stone_Red_Utilities.Logging;
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Windows;
|
||||
|
||||
namespace DesktopMagic
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for App.xaml
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
private readonly string logFilePath;
|
||||
private readonly Mutex _mutex;
|
||||
#if DEBUG
|
||||
private readonly Updater updater = new Updater(TimeSpan.FromDays(1), "https://raw.githubusercontent.com/Stone-Red-Code/DesktopMagic/develop/update/updateInfo.json");
|
||||
#else
|
||||
private readonly Updater updater = new Updater(TimeSpan.FromDays(1), "https://raw.githubusercontent.com/Stone-Red-Code/DesktopMagic/main/update/updateInfo.json");
|
||||
#endif
|
||||
|
||||
public const string AppName = "Desktop Magic";
|
||||
public static string ApplicationDataPath { get; } = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\" + AppName;
|
||||
|
||||
public static Logger Logger { get; } = new Logger();
|
||||
|
||||
public App()
|
||||
{
|
||||
logFilePath = ApplicationDataPath + "\\Log.log";
|
||||
Setup();
|
||||
// Try to grab mutex
|
||||
_mutex = new Mutex(true, $"Stone_Red{AppName}", out bool createdNew);
|
||||
|
||||
//check if creating new was successful
|
||||
if (!createdNew)
|
||||
{
|
||||
Logger.Log("Shutting down because other instance already running.", "Setup");
|
||||
//Shutdown Application
|
||||
Current.Shutdown();
|
||||
}
|
||||
else
|
||||
{
|
||||
Exit += CloseMutexHandler;
|
||||
|
||||
updater.ProgressChanged += Updater_ProgressChanged;
|
||||
updater.OnException += Updater_OnException;
|
||||
updater.NoUpdateAvailible += Updater_NoUpdateAvailible;
|
||||
updater.UpdateAvailible += Updater_UpdateAvailible;
|
||||
updater.Start();
|
||||
}
|
||||
}
|
||||
|
||||
private void Updater_UpdateAvailible(string version, string additionalInformation)
|
||||
{
|
||||
updater.Update();
|
||||
}
|
||||
|
||||
private void Updater_NoUpdateAvailible()
|
||||
{
|
||||
Logger.Log("No update available.", "Updater");
|
||||
}
|
||||
|
||||
private void Updater_OnException(Exception exception)
|
||||
{
|
||||
Logger.Log(exception.ToString(), "Updater");
|
||||
}
|
||||
|
||||
private void Updater_ProgressChanged(long? totalFileSize, long totalBytesDownloaded, double? progressPercentage)
|
||||
{
|
||||
Logger.Log($"{progressPercentage}% {totalBytesDownloaded}/{totalFileSize}", "Updater");
|
||||
}
|
||||
|
||||
protected void CloseMutexHandler(object sender, EventArgs e)
|
||||
{
|
||||
_mutex?.Close();
|
||||
}
|
||||
|
||||
private void Setup()
|
||||
{
|
||||
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
|
||||
|
||||
Logger.Config = new LogConfig()
|
||||
{
|
||||
FatalConfig = new OutputConfig()
|
||||
{
|
||||
Color = ConsoleColor.DarkRed,
|
||||
LogTarget = LogTarget.DebugConsole | LogTarget.File,
|
||||
FilePath = logFilePath
|
||||
},
|
||||
ErrorConfig = new OutputConfig()
|
||||
{
|
||||
Color = ConsoleColor.Red,
|
||||
LogTarget = LogTarget.DebugConsole | LogTarget.File,
|
||||
FilePath = logFilePath
|
||||
},
|
||||
WarnConfig = new OutputConfig()
|
||||
{
|
||||
Color = ConsoleColor.Yellow,
|
||||
LogTarget = LogTarget.DebugConsole | LogTarget.File,
|
||||
FilePath = logFilePath
|
||||
},
|
||||
InfoConfig = new OutputConfig()
|
||||
{
|
||||
Color = ConsoleColor.White,
|
||||
LogTarget = LogTarget.DebugConsole | LogTarget.File,
|
||||
FilePath = logFilePath
|
||||
},
|
||||
DebugConfig = new OutputConfig()
|
||||
{
|
||||
Color = ConsoleColor.Gray,
|
||||
LogTarget = LogTarget.DebugConsole,
|
||||
},
|
||||
FormatConfig = new FormatConfig()
|
||||
{
|
||||
DebugConsoleFormat = $"> {{{LogFormatType.DateTime}:hh:mm:ss}} | {{{LogFormatType.LogSeverity},-5}} | {{{LogFormatType.Message}}}\nat {{{LogFormatType.LineNumber}}} | {{{LogFormatType.FilePath}}}"
|
||||
}
|
||||
};
|
||||
|
||||
try
|
||||
{
|
||||
if (!Directory.Exists(ApplicationDataPath))
|
||||
{
|
||||
_ = Directory.CreateDirectory(ApplicationDataPath);
|
||||
}
|
||||
Logger.Log("Created ApplicationData Folder", "Main");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Log(ex.Message, "Setup", LogSeverity.Error);
|
||||
_ = MessageBox.Show(ex.ToString());
|
||||
}
|
||||
|
||||
Logger.ClearLogFile(LogSeverity.Info);
|
||||
Logger.Log("Log setup complete.", "Setup");
|
||||
}
|
||||
|
||||
private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
|
||||
{
|
||||
Exception exception = (Exception)e.ExceptionObject;
|
||||
Logger.Log(exception + (e.IsTerminating ? "\t Process terminating!" : ""), exception.Source, LogSeverity.Fatal);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net5.0-windows</TargetFramework>
|
||||
<UseWPF>true</UseWPF>
|
||||
<RootNamespace>DesktopMagic</RootNamespace>
|
||||
<ApplicationIcon>icon.ico</ApplicationIcon>
|
||||
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
|
||||
<Authors>Stone_Red</Authors>
|
||||
<Version>0.0.3.1</Version>
|
||||
<PackageProjectUrl>https://github.com/Stone-Red-Code/DesktopMagic</PackageProjectUrl>
|
||||
<RepositoryUrl>https://github.com/Stone-Red-Code/DesktopMagic</RepositoryUrl>
|
||||
<AssemblyVersion>0.0.3.1</AssemblyVersion>
|
||||
<FileVersion>0.0.3.1</FileVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="icon.ico" />
|
||||
<None Remove="icons8_volunteering_26_85L_icon.ico" />
|
||||
<None Remove="icon_Dark.ico" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="AlwaysUpToDate" Version="1.0.0.4" />
|
||||
<PackageReference Include="Extended.Wpf.Toolkit" Version="4.1.0" />
|
||||
<PackageReference Include="Google.Apis.Calendar.v3" Version="1.55.0.2410" />
|
||||
<PackageReference Include="MaterialDesignThemes" Version="4.0.0" />
|
||||
<PackageReference Include="NAudio" Version="2.0.1" />
|
||||
<PackageReference Include="Stone_Red-C-Sharp-Utilities" Version="1.0.3.1" />
|
||||
<PackageReference Include="System.Management" Version="5.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\DesktopMagicPluginAPI\DesktopMagicPluginAPI.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Resource Include="icon_Dark.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Resource>
|
||||
<Resource Include="icon.ico">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Resource>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,870 @@
|
||||
using DesktopMagic.BuiltInWindowElements;
|
||||
using DesktopMagic.Dialogs;
|
||||
using DesktopMagic.Helpers;
|
||||
using DesktopMagic.Plugins;
|
||||
|
||||
using Microsoft.Win32;
|
||||
|
||||
using Stone_Red_Utilities.Logging;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace DesktopMagic
|
||||
{
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
#region Global settings
|
||||
|
||||
internal static Theme Theme = new Theme();
|
||||
public static bool EditMode { get; private set; } = false;
|
||||
|
||||
#endregion Global settings
|
||||
|
||||
#region Music Visualizer Settings
|
||||
|
||||
public static int SpectrumMode { get; private set; } = 0;
|
||||
public static int AmplifierLevel { get; private set; } = 0;
|
||||
public static bool MirrorMode { get; private set; } = false;
|
||||
public static bool LineMode { get; private set; } = false;
|
||||
public static System.Drawing.Color? MusicVisualzerColor { get; private set; }
|
||||
|
||||
#endregion Music Visualizer Settings
|
||||
|
||||
#region Plugins settings
|
||||
|
||||
internal static Dictionary<string, List<SettingElement>> PluginsSettings { get; } = new Dictionary<string, List<SettingElement>>();
|
||||
|
||||
#endregion Plugins settings
|
||||
|
||||
public static List<PluginWindow> Windows { get; } = new List<PluginWindow>();
|
||||
public static List<string> WindowNames { get; } = new List<string>();
|
||||
private readonly RegistryKey key;
|
||||
private readonly System.Windows.Forms.NotifyIcon notifyIcon = new();
|
||||
|
||||
private bool loaded = false;
|
||||
|
||||
private bool blockWindowsClosing = true;
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
try
|
||||
{
|
||||
key = Registry.CurrentUser.CreateSubKey(@"Software\" + App.AppName);
|
||||
|
||||
Stream iconStream = Application.GetResourceStream(new Uri("pack://application:,,,/DesktopMagic;component/icon.ico")).Stream;
|
||||
notifyIcon.Click += TaskbarIcon_TrayLeftClick;
|
||||
notifyIcon.Visible = true;
|
||||
notifyIcon.Text = App.AppName;
|
||||
notifyIcon.Icon = new System.Drawing.Icon(iconStream);
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
SetLanguageDictionary();
|
||||
|
||||
#if DEBUG
|
||||
Title = $"{App.AppName} - Dev {Assembly.GetExecutingAssembly().GetName().Version}";
|
||||
#else
|
||||
Title = $"{App.AppName} - {Assembly.GetExecutingAssembly().GetName().Version}";
|
||||
#endif
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_ = MessageBox.Show(ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
#region Load
|
||||
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!Directory.Exists(App.ApplicationDataPath + "\\Plugins"))
|
||||
{
|
||||
_ = Directory.CreateDirectory(App.ApplicationDataPath + "\\Plugins");
|
||||
}
|
||||
App.Logger.Log("Created Plugins Folder", "Main");
|
||||
|
||||
if (!File.Exists(App.ApplicationDataPath + "\\layouts.save"))
|
||||
{
|
||||
File.WriteAllText(App.ApplicationDataPath + "\\layouts.save", ";" + (string)FindResource("default"));
|
||||
}
|
||||
App.Logger.Log("Created layouts.save file", "Main");
|
||||
|
||||
//Write To Log File and Load Elements
|
||||
|
||||
App.Logger.Log("Loading Plugin names", "Main");
|
||||
LoadPlugins();
|
||||
App.Logger.Log("Loading Layout names", "Main");
|
||||
LoadLayoutNames();
|
||||
App.Logger.Log("Loading Layout", "Main");
|
||||
LoadLayout();
|
||||
|
||||
loaded = true;
|
||||
App.Logger.Log("Window Loaded", "Main");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
App.Logger.Log(ex.Message, "Main", LogSeverity.Error);
|
||||
_ = MessageBox.Show(ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadPlugins()
|
||||
{
|
||||
string PluginsPath = App.ApplicationDataPath + "\\Plugins";
|
||||
|
||||
foreach (string fileName in Directory.GetFiles(PluginsPath, "*.dll"))
|
||||
{
|
||||
string PluginName = fileName[(fileName.LastIndexOf("\\", StringComparison.InvariantCulture) + 1)..].Replace(fileName[fileName.LastIndexOf(".", StringComparison.InvariantCulture)..], "");
|
||||
try
|
||||
{
|
||||
_ = Directory.CreateDirectory(PluginsPath + "\\" + PluginName);
|
||||
File.Move(fileName, $"{PluginsPath}\\{PluginName}\\{PluginName}.dll");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
App.Logger.Log(ex.Message, "Main", LogSeverity.Error);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (string directory in Directory.GetDirectories(PluginsPath))
|
||||
{
|
||||
foreach (string fileName in Directory.GetFiles(directory).Where(s => s.EndsWith(".dll", StringComparison.InvariantCulture) || s.EndsWith(".cs", StringComparison.InvariantCulture)))
|
||||
{
|
||||
string badChars = ",#-<>?!=()*,. ";
|
||||
string PluginName = fileName[(fileName.LastIndexOf("\\", StringComparison.InvariantCulture) + 1)..].Replace(fileName[fileName.LastIndexOf(".", StringComparison.InvariantCulture)..], "");
|
||||
string clearPluginName = PluginName;
|
||||
|
||||
if (PluginName == directory[(directory.LastIndexOf("\\", StringComparison.InvariantCulture) + 1)..])
|
||||
{
|
||||
foreach (char c in badChars)
|
||||
{
|
||||
clearPluginName = clearPluginName.Replace(c, '_');
|
||||
}
|
||||
|
||||
CheckBox checkBox = new()
|
||||
{
|
||||
Name = "_PluginCb_" + clearPluginName,
|
||||
Content = PluginName
|
||||
};
|
||||
checkBox.Style = (Style)FindResource("MaterialDesignDarkCheckBox");
|
||||
checkBox.Click += CheckBox_Click;
|
||||
|
||||
bool exists = false;
|
||||
foreach (UIElement item in stackPanel.Children)
|
||||
{
|
||||
if (((CheckBox)item).Name == "_PluginCb_" + clearPluginName)
|
||||
{
|
||||
exists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!exists)
|
||||
{
|
||||
_ = stackPanel.Children.Add(checkBox);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Load
|
||||
|
||||
#region Windows
|
||||
|
||||
private void EditCheckBox_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
EditMode = (bool)EditCheckBox.IsChecked;
|
||||
SaveLayout();
|
||||
}
|
||||
|
||||
private void CheckBox_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
CheckBox checkBox = (CheckBox)sender;
|
||||
PluginWindow window = null;
|
||||
blockWindowsClosing = false;
|
||||
|
||||
switch (checkBox.Name)
|
||||
{
|
||||
case "TimeCb":
|
||||
window = new PluginWindow(new TimePlugin(), checkBox.Content.ToString());
|
||||
break;
|
||||
|
||||
case "DateCb":
|
||||
window = new PluginWindow(new DatePlugin(), checkBox.Content.ToString());
|
||||
break;
|
||||
|
||||
case "CpuUsageCb":
|
||||
//window = new PluginWindow();
|
||||
break;
|
||||
|
||||
case "MusicVisualizerCb":
|
||||
window = new PluginWindow(new MusicVisualizerPlugin(), checkBox.Content.ToString());
|
||||
break;
|
||||
|
||||
default:
|
||||
if (!checkBox.Name.Contains("_PluginCb_"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
window = new PluginWindow(checkBox.Content.ToString());
|
||||
break;
|
||||
}
|
||||
|
||||
if (window is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
window.Title = checkBox.Content.ToString();
|
||||
if (!WindowNames.Contains(window.Title) && checkBox.IsChecked == true)
|
||||
{
|
||||
_ = Task.Run(() =>
|
||||
{
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
Action onPluginLoaded = null;
|
||||
onPluginLoaded = () =>
|
||||
{
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
if (!optionsComboBox.Items.Contains(checkBox.Content.ToString()))
|
||||
{
|
||||
_ = optionsComboBox.Items.Add(checkBox.Content.ToString());
|
||||
}
|
||||
optionsComboBox.SelectedIndex = -1;
|
||||
optionsComboBox.SelectedIndex = optionsComboBox.Items.IndexOf(checkBox.Content.ToString());
|
||||
window.PluginLoaded -= onPluginLoaded;
|
||||
});
|
||||
};
|
||||
window.OnExit += () =>
|
||||
{
|
||||
checkBox.IsChecked = false;
|
||||
CheckBox_Click(checkBox, null);
|
||||
};
|
||||
window.PluginLoaded += onPluginLoaded;
|
||||
|
||||
window.ShowInTaskbar = false;
|
||||
window.Show();
|
||||
window.ContentRendered += DisplayWindow_ContentRendered;
|
||||
window.Closing += DisplayWindow_Closing;
|
||||
Windows.Add(window);
|
||||
WindowNames.Add(window.Title);
|
||||
});
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
int index = WindowNames.IndexOf(window.Title);
|
||||
|
||||
if (index >= 0)
|
||||
{
|
||||
//Not sure how to handle this
|
||||
try
|
||||
{
|
||||
Windows[index].Close();
|
||||
|
||||
Windows.RemoveAt(index);
|
||||
WindowNames.RemoveAt(index);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
key.SetValue(checkBox.Name, checkBox.IsChecked.ToString());
|
||||
blockWindowsClosing = true;
|
||||
SaveLayout();
|
||||
}
|
||||
|
||||
private void DisplayWindow_ContentRendered(object sender, EventArgs e)
|
||||
{
|
||||
WindowPos.SendWpfWindowBack(sender as Window);
|
||||
WindowPos.SendWpfWindowBack(sender as Window);
|
||||
}
|
||||
|
||||
private void DisplayWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
e.Cancel = blockWindowsClosing;
|
||||
}
|
||||
|
||||
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
MessageBoxResult msbRes = MessageBox.Show((string)FindResource("wantToCloseProgram"), App.AppName, MessageBoxButton.YesNo);
|
||||
e.Cancel = msbRes != MessageBoxResult.Yes;
|
||||
}
|
||||
|
||||
private void Window_Closed(object sender, EventArgs e)
|
||||
{
|
||||
Visibility = Visibility.Collapsed;
|
||||
UpdateLayout();
|
||||
foreach (Window window in Windows)
|
||||
{
|
||||
window.Hide();
|
||||
}
|
||||
Environment.Exit(0);
|
||||
}
|
||||
|
||||
private void Window_StateChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (WindowState == WindowState.Minimized)
|
||||
{
|
||||
EditCheckBox.IsChecked = false;
|
||||
EditCheckBox_Click(null, null);
|
||||
ShowInTaskbar = false;
|
||||
Visibility = Visibility.Collapsed;
|
||||
foreach (Window item in Windows)
|
||||
{
|
||||
WindowPos.SendWpfWindowBack(item);
|
||||
WindowPos.SendWpfWindowBack(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Windows
|
||||
|
||||
#region Options
|
||||
|
||||
private void AmplifierLevelSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
|
||||
{
|
||||
amplifierLevelLabel.Content = (int)amplifierLevelSlider.Value;
|
||||
AmplifierLevel = (int)amplifierLevelSlider.Value;
|
||||
key.SetValue("AmplifierLevel", AmplifierLevel);
|
||||
SaveLayout();
|
||||
}
|
||||
|
||||
private void MirrorModeCheckBox_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
MirrorMode = (bool)mirrorModeCheckBox.IsChecked;
|
||||
key.SetValue("MirrorMode", mirrorModeCheckBox.IsChecked.ToString());
|
||||
SaveLayout();
|
||||
}
|
||||
|
||||
private void LineModeCheckBox_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
LineMode = (bool)lineModeCheckBox.IsChecked;
|
||||
key.SetValue("LineMode", lineModeCheckBox.IsChecked.ToString());
|
||||
SaveLayout();
|
||||
}
|
||||
|
||||
private void MusicVisualizerColorTextBox_TextChanged(object sender, TextChangedEventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(musicVisualizerColorTextBox.Text) && musicVisualizerColorTextBox.Text != "Default")
|
||||
{
|
||||
if (musicVisualizerColorTextBox.Text.Length > 0)
|
||||
{
|
||||
if (musicVisualizerColorTextBox.Text.ToCharArray()[0] != '#')
|
||||
{
|
||||
musicVisualizerColorTextBox.Text = "#" + musicVisualizerColorTextBox.Text.Replace("#", "");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
musicVisualizerColorTextBox.Text = "#";
|
||||
musicVisualizerColorTextBox.Select(musicVisualizerColorTextBox.Text.Length, 0);
|
||||
}
|
||||
|
||||
if (musicVisualizerColorTextBox.SelectionStart == 0)
|
||||
{
|
||||
if (musicVisualizerColorTextBox.Text.Length <= 2)
|
||||
{
|
||||
musicVisualizerColorTextBox.Select(musicVisualizerColorTextBox.Text.Length, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
musicVisualizerColorTextBox.Select(1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
string hex = musicVisualizerColorTextBox.Text;
|
||||
|
||||
if (MultiColorConverter.TryConvertToSystemColor(hex, out System.Drawing.Color systemColor))
|
||||
{
|
||||
MusicVisualzerColor = systemColor;
|
||||
musicVisualizerColorTextBox.Foreground = Brushes.Black;
|
||||
|
||||
key.SetValue("MusicVisualizerColor", musicVisualizerColorTextBox.Text);
|
||||
SaveLayout();
|
||||
}
|
||||
else
|
||||
{
|
||||
musicVisualizerColorTextBox.Foreground = Brushes.Red;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
MusicVisualzerColor = null;
|
||||
key.SetValue("MusicVisualizerColor", musicVisualizerColorTextBox.Text);
|
||||
SaveLayout();
|
||||
}
|
||||
}
|
||||
|
||||
private void FontComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
Theme.Font = fontComboBox.SelectedValue.ToString().Replace("System.Windows.Controls.ComboBoxItem: ", "");
|
||||
key.SetValue("Font", Theme.Font);
|
||||
SaveLayout();
|
||||
}
|
||||
|
||||
private void SpectrumModeComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
SpectrumMode = spectrumModeComboBox.SelectedIndex;
|
||||
key.SetValue("SpectrumMode", spectrumModeComboBox.SelectedIndex);
|
||||
|
||||
mirrorModeCheckBox.IsEnabled = spectrumModeComboBox.SelectedIndex != 1;
|
||||
SaveLayout();
|
||||
}
|
||||
|
||||
private void OptionsComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (optionsComboBox.SelectedIndex < 1)
|
||||
{
|
||||
if (musicVisualizerOptionsPanel != null)
|
||||
{
|
||||
musicVisualizerOptionsPanel.Visibility = Visibility.Visible;
|
||||
optionsPanel.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
musicVisualizerOptionsPanel.Visibility = Visibility.Collapsed;
|
||||
optionsPanel.Visibility = Visibility.Visible;
|
||||
optionsPanel.Children.Clear();
|
||||
optionsPanel.UpdateLayout();
|
||||
|
||||
bool success = PluginsSettings.TryGetValue(optionsComboBox.SelectedItem.ToString(), out List<SettingElement> settingElements);
|
||||
if (!success || settingElements?.Count == 0)
|
||||
{
|
||||
_ = optionsPanel.Children.Add(new TextBlock() { Text = (string)FindResource("noOptions") });
|
||||
return;
|
||||
}
|
||||
|
||||
SettingElementGenerator settingElementGenerator = new SettingElementGenerator(optionsComboBox);
|
||||
|
||||
foreach (SettingElement settingElement in settingElements)
|
||||
{
|
||||
DockPanel dockPanel = new()
|
||||
{
|
||||
LastChildFill = true,
|
||||
HorizontalAlignment = HorizontalAlignment.Stretch
|
||||
};
|
||||
_ = optionsPanel.Children.Add(dockPanel);
|
||||
|
||||
TextBlock textBlock = new()
|
||||
{
|
||||
Text = settingElement.Name,
|
||||
Padding = new Thickness(0, 0, 3, 0),
|
||||
VerticalAlignment = VerticalAlignment.Center
|
||||
};
|
||||
|
||||
_ = dockPanel.Children.Add(textBlock);
|
||||
settingElementGenerator.Generate(settingElement, dockPanel, textBlock);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Options
|
||||
|
||||
private void TextBlock_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
int index = 0;
|
||||
foreach (FontFamily ff in Fonts.SystemFontFamilies)
|
||||
{
|
||||
ComboBoxItem comboBoxItem = new()
|
||||
{
|
||||
FontFamily = ff,
|
||||
Content = ff.ToString()
|
||||
};
|
||||
_ = fontComboBox.Items.Add(comboBoxItem);
|
||||
|
||||
if (ff.ToString() == Theme.Font)
|
||||
{
|
||||
fontComboBox.SelectedIndex = index;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
if (fontComboBox.SelectedIndex == -1)
|
||||
{
|
||||
fontComboBox.SelectedIndex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private void ChangePrimaryColorButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ColorDialog colorDialog = new ColorDialog("Set Primary Color", Theme.PrimaryColor);
|
||||
if (colorDialog.ShowDialog() == true)
|
||||
{
|
||||
Theme.PrimaryBrush = colorDialog.ResultBrush;
|
||||
Theme.PrimaryColor = colorDialog.ResultColor;
|
||||
primaryColorRechtangle.Fill = colorDialog.ResultBrush;
|
||||
|
||||
key.SetValue("PrimaryColor", MultiColorConverter.ConvertToHex(Theme.PrimaryColor));
|
||||
SaveLayout();
|
||||
}
|
||||
}
|
||||
|
||||
private void ChangeSecondaryColorButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ColorDialog colorDialog = new ColorDialog("Set Secondary Color", Theme.SecondaryColor);
|
||||
if (colorDialog.ShowDialog() == true)
|
||||
{
|
||||
Theme.SecondaryBrush = colorDialog.ResultBrush;
|
||||
Theme.SecondaryColor = colorDialog.ResultColor;
|
||||
secondaryColorRechtangle.Fill = colorDialog.ResultBrush;
|
||||
|
||||
key.SetValue("SecondaryColor", MultiColorConverter.ConvertToHex(Theme.SecondaryColor));
|
||||
SaveLayout();
|
||||
}
|
||||
}
|
||||
|
||||
private void ChangeBackgroundColorButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ColorDialog colorDialog = new ColorDialog("Set Background Color", Theme.BackgroundColor);
|
||||
if (colorDialog.ShowDialog() == true)
|
||||
{
|
||||
Theme.BackgroundBrush = colorDialog.ResultBrush;
|
||||
Theme.BackgroundColor = colorDialog.ResultColor;
|
||||
backgroundColorRechtangle.Fill = colorDialog.ResultBrush;
|
||||
|
||||
key.SetValue("BackgroundColor", MultiColorConverter.ConvertToHex(Theme.BackgroundColor));
|
||||
SaveLayout();
|
||||
}
|
||||
}
|
||||
|
||||
private void CornerRadiusTextBox_TextChanged(object sender, TextChangedEventArgs e)
|
||||
{
|
||||
bool sucess = int.TryParse(cornerRadiusTextBox.Text, out int cornerRadius);
|
||||
if (sucess)
|
||||
{
|
||||
cornerRadiusTextBox.Foreground = Brushes.Black;
|
||||
Theme.CornerRadius = cornerRadius;
|
||||
key.SetValue("CornerRadius", cornerRadius);
|
||||
SaveLayout();
|
||||
}
|
||||
else
|
||||
{
|
||||
cornerRadiusTextBox.Foreground = Brushes.Red;
|
||||
}
|
||||
}
|
||||
|
||||
private void MarginTextBox_TextChanged(object sender, TextChangedEventArgs e)
|
||||
{
|
||||
bool sucess = int.TryParse(marginTextBox.Text, out int margin);
|
||||
if (sucess)
|
||||
{
|
||||
marginTextBox.Foreground = Brushes.Black;
|
||||
Theme.Margin = margin;
|
||||
key.SetValue("Margin", margin);
|
||||
SaveLayout();
|
||||
}
|
||||
else
|
||||
{
|
||||
marginTextBox.Foreground = Brushes.Red;
|
||||
}
|
||||
}
|
||||
|
||||
#region Layout
|
||||
|
||||
private void LayoutsComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
removeLayoutButton.IsEnabled = layoutsComboBox.SelectedIndex != 0;
|
||||
|
||||
if (layoutsComboBox.SelectedIndex == -1 || !loaded)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
key.SetValue("SelectedLayout", layoutsComboBox.SelectedIndex);
|
||||
|
||||
string[] lines = File.ReadAllLines(App.ApplicationDataPath + "\\layouts.save");
|
||||
string[] data = lines[layoutsComboBox.SelectedIndex].Split(';');
|
||||
foreach (string dat in data)
|
||||
{
|
||||
if (dat.Contains(":"))
|
||||
{
|
||||
string value = dat[(dat.LastIndexOf(":", StringComparison.InvariantCulture) + 1)..];
|
||||
string name = dat.Replace(":" + value, "");
|
||||
key.SetValue(name, value);
|
||||
}
|
||||
}
|
||||
LoadLayout(false);
|
||||
for (int i = 0; i < fontComboBox.Items.Count; i++)
|
||||
{
|
||||
ComboBoxItem comboBoxItem = (ComboBoxItem)fontComboBox.Items[i];
|
||||
if (comboBoxItem.FontFamily.ToString() == Theme.Font)
|
||||
{
|
||||
fontComboBox.SelectedIndex = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void NewLayoutButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
InputDialog inputDialog = new((string)FindResource("enterLayoutName"));
|
||||
if (inputDialog.ShowDialog() == true)
|
||||
{
|
||||
string content = "";
|
||||
foreach (string valueName in key.GetValueNames())
|
||||
{
|
||||
if (valueName != "SelectedLayout")
|
||||
{
|
||||
content += valueName + ":" + key.GetValue(valueName).ToString() + ";";
|
||||
}
|
||||
}
|
||||
content += inputDialog.ResponseText + "\n";
|
||||
|
||||
File.AppendAllText(App.ApplicationDataPath + "\\layouts.save", content);
|
||||
key.SetValue("SelectedLayout", -1);
|
||||
LoadLayoutNames();
|
||||
layoutsComboBox.SelectedIndex = layoutsComboBox.Items.Count - 1;
|
||||
}
|
||||
}
|
||||
|
||||
private void RemoveLayoutButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (layoutsComboBox.SelectedIndex == -1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
List<string> lines = File.ReadAllLines(App.ApplicationDataPath + "\\layouts.save").ToList();
|
||||
lines.RemoveAt(layoutsComboBox.SelectedIndex);
|
||||
File.WriteAllLines(App.ApplicationDataPath + "\\layouts.save", lines);
|
||||
LoadLayoutNames();
|
||||
layoutsComboBox.SelectedIndex = 0;
|
||||
}
|
||||
|
||||
private void SaveLayout()
|
||||
{
|
||||
if (!loaded)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_ = Task.Run(() =>
|
||||
{
|
||||
lock (App.ApplicationDataPath)
|
||||
{
|
||||
List<string> lines = File.ReadAllLines(App.ApplicationDataPath + "\\layouts.save").ToList();
|
||||
string content = "";
|
||||
foreach (string valueName in key.GetValueNames())
|
||||
{
|
||||
if (valueName != "SelectedLayout")
|
||||
{
|
||||
content += valueName + ":" + key.GetValue(valueName).ToString() + ";";
|
||||
}
|
||||
}
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
content += layoutsComboBox.SelectedItem.ToString();
|
||||
lines[layoutsComboBox.SelectedIndex] = content;
|
||||
});
|
||||
File.WriteAllLines(App.ApplicationDataPath + "\\layouts.save", lines);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void LoadLayoutNames()
|
||||
{
|
||||
layoutsComboBox.Items.Clear();
|
||||
string[] lines = File.ReadAllLines(App.ApplicationDataPath + "\\layouts.save");
|
||||
|
||||
foreach (string line in lines)
|
||||
{
|
||||
string name = line[(line.LastIndexOf(";", StringComparison.InvariantCulture) + 1)..];
|
||||
_ = layoutsComboBox.Items.Add(name);
|
||||
}
|
||||
layoutsComboBox.SelectedIndex = int.Parse(key.GetValue("SelectedLayout", "0").ToString(), CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
private void LoadLayout(bool minimize = true)
|
||||
{
|
||||
Theme.Font = key.GetValue("Font", "Segoe UI").ToString();
|
||||
spectrumModeComboBox.SelectedIndex = int.Parse(key.GetValue("SpectrumMode", "0").ToString(), CultureInfo.InvariantCulture);
|
||||
amplifierLevelSlider.Value = int.Parse(key.GetValue("AmplifierLevel", "0").ToString(), CultureInfo.InvariantCulture);
|
||||
mirrorModeCheckBox.IsChecked = bool.Parse(key.GetValue("MirrorMode", "false").ToString());
|
||||
lineModeCheckBox.IsChecked = bool.Parse(key.GetValue("LineMode", "false").ToString());
|
||||
musicVisualizerColorTextBox.Text = key.GetValue("MusicVisualizerColor", "").ToString();
|
||||
cornerRadiusTextBox.Text = key.GetValue("CornerRadius", "0").ToString();
|
||||
marginTextBox.Text = key.GetValue("Margin", "0").ToString();
|
||||
blockWindowsClosing = false;
|
||||
|
||||
string primaryColorHex = key.GetValue("PrimaryColor", "#FFFFFFFF").ToString();
|
||||
string secondaryColorHex = key.GetValue("SecondaryColor", "#FFFFFFFF").ToString();
|
||||
string backgroundColorHex = key.GetValue("BackgroundColor", "#00FFFFFF").ToString();
|
||||
|
||||
_ = MultiColorConverter.TryConvertToSystemColor(primaryColorHex, out System.Drawing.Color primarySystemColor);
|
||||
_ = MultiColorConverter.TryConvertToMediaColor(primaryColorHex, out Color primaryMediaColor);
|
||||
_ = MultiColorConverter.TryConvertToSystemColor(secondaryColorHex, out System.Drawing.Color secondarySystemColor);
|
||||
_ = MultiColorConverter.TryConvertToMediaColor(secondaryColorHex, out Color secondaryMediaColor);
|
||||
_ = MultiColorConverter.TryConvertToSystemColor(backgroundColorHex, out System.Drawing.Color backgroundSystemColor);
|
||||
_ = MultiColorConverter.TryConvertToMediaColor(backgroundColorHex, out Color backgroundMediaColor);
|
||||
|
||||
Theme.PrimaryColor = primarySystemColor;
|
||||
Theme.PrimaryBrush = new SolidColorBrush(primaryMediaColor);
|
||||
|
||||
Theme.SecondaryColor = secondarySystemColor;
|
||||
Theme.SecondaryBrush = new SolidColorBrush(secondaryMediaColor);
|
||||
|
||||
Theme.BackgroundColor = backgroundSystemColor;
|
||||
Theme.BackgroundBrush = new SolidColorBrush(backgroundMediaColor);
|
||||
|
||||
primaryColorRechtangle.Fill = Theme.PrimaryBrush;
|
||||
secondaryColorRechtangle.Fill = Theme.SecondaryBrush;
|
||||
backgroundColorRechtangle.Fill = Theme.BackgroundBrush;
|
||||
|
||||
MusicVisualizerColorTextBox_TextChanged(null, null);
|
||||
MirrorModeCheckBox_Click(null, null);
|
||||
LineModeCheckBox_Click(null, null);
|
||||
SpectrumModeComboBox_SelectionChanged(null, null);
|
||||
AmplifierLevelSlider_ValueChanged(null, null);
|
||||
CornerRadiusTextBox_TextChanged(null, null);
|
||||
MarginTextBox_TextChanged(null, null);
|
||||
|
||||
foreach (Window window in Windows)
|
||||
{
|
||||
window.Close();
|
||||
}
|
||||
|
||||
EditCheckBox.IsChecked = false;
|
||||
EditMode = false;
|
||||
blockWindowsClosing = true;
|
||||
Windows.Clear();
|
||||
WindowNames.Clear();
|
||||
optionsComboBox.Items.Clear();
|
||||
|
||||
_ = optionsComboBox.Items.Add((string)FindResource("musicVisualizer"));
|
||||
|
||||
IEnumerable<CheckBox> list = stackPanel.Children.OfType<CheckBox>();
|
||||
bool showWindow = true;
|
||||
|
||||
try
|
||||
{
|
||||
foreach (CheckBox checkBox in list)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (key.GetValue(checkBox.Name, "False").ToString() == "True")
|
||||
{
|
||||
checkBox.IsChecked = true;
|
||||
CheckBox_Click(checkBox, null);
|
||||
showWindow = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
checkBox.IsChecked = false;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
App.Logger.Log(ex.ToString(), "Main");
|
||||
_ = MessageBox.Show(ex.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
App.Logger.Log(ex.ToString(), "Main");
|
||||
_ = MessageBox.Show(ex.ToString());
|
||||
}
|
||||
|
||||
if (!showWindow && minimize)
|
||||
{
|
||||
WindowState = WindowState.Minimized;
|
||||
Window_StateChanged(null, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
WindowState = WindowState.Normal;
|
||||
Window_StateChanged(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Layout
|
||||
|
||||
private void UpdatePluginsButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
LoadPlugins();
|
||||
_ = Task.Run(() =>
|
||||
{
|
||||
foreach (Window window in Windows.ToArray())
|
||||
{
|
||||
if (window.GetType() == typeof(PluginWindow))
|
||||
{
|
||||
((PluginWindow)window).UpdatePluginWindow();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void OpenPluginsFolderButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
_ = Process.Start("explorer.exe", App.ApplicationDataPath + "\\Plugins");
|
||||
}
|
||||
|
||||
private void ScrollViewer_PreviewMouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e)
|
||||
{
|
||||
ScrollViewer scv = (ScrollViewer)sender;
|
||||
scv.ScrollToVerticalOffset(scv.VerticalOffset - e.Delta);
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void TaskbarIcon_TrayLeftClick(object sender, EventArgs e)
|
||||
{
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
ShowInTaskbar = true;
|
||||
Visibility = Visibility.Visible;
|
||||
SystemCommands.RestoreWindow(this);
|
||||
Topmost = true;
|
||||
_ = Activate();
|
||||
Topmost = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void GithubButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
string uri = "https://github.com/Stone-Red-Code/DesktopMagic";
|
||||
ProcessStartInfo psi = new ProcessStartInfo();
|
||||
psi.UseShellExecute = true;
|
||||
psi.FileName = uri;
|
||||
_ = Process.Start(psi);
|
||||
}
|
||||
|
||||
private void DownloadPluginsButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
string uri = "https://github.com/Stone-Red-Code/DesktopMagic-Plugins";
|
||||
ProcessStartInfo psi = new ProcessStartInfo();
|
||||
psi.UseShellExecute = true;
|
||||
psi.FileName = uri;
|
||||
_ = Process.Start(psi);
|
||||
}
|
||||
|
||||
private void SetLanguageDictionary()
|
||||
{
|
||||
ResourceDictionary dict = new ResourceDictionary();
|
||||
string currentCulture = Thread.CurrentThread.CurrentUICulture.ToString();
|
||||
|
||||
if (currentCulture.Contains("de"))
|
||||
{
|
||||
dict.Source = new Uri("..\\Resources\\StringResources.de.xaml", UriKind.Relative);
|
||||
}
|
||||
else
|
||||
{
|
||||
dict.Source = new Uri("..\\Resources\\StringResources.en.xaml", UriKind.Relative);
|
||||
}
|
||||
Resources.MergedDictionaries.Add(dict);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using DesktopMagicPluginAPI;
|
||||
|
||||
using System.Drawing;
|
||||
|
||||
namespace DesktopMagic.Plugins
|
||||
{
|
||||
internal class PluginData : IPluginData
|
||||
{
|
||||
private readonly PluginWindow window;
|
||||
|
||||
public PluginData(PluginWindow window)
|
||||
{
|
||||
this.window = window;
|
||||
}
|
||||
|
||||
public string Font => Theme.Font;
|
||||
|
||||
public Color Color => Theme.PrimaryColor;
|
||||
|
||||
public ITheme Theme { get; } = MainWindow.Theme;
|
||||
|
||||
public Size WindowSize => new Size((int)window.ActualWidth, (int)window.ActualHeight);
|
||||
|
||||
public Point WindowPosition => new Point((int)window.Left, (int)window.Top);
|
||||
|
||||
public string PluginName => window.PluginName;
|
||||
|
||||
public string PluginPath => window.PluginFolderPath;
|
||||
|
||||
public void UpdateWindow()
|
||||
{
|
||||
window.UpdatePluginWindow();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,407 @@
|
||||
using DesktopMagic.Plugins;
|
||||
|
||||
using DesktopMagicPluginAPI;
|
||||
using DesktopMagicPluginAPI.Drawing;
|
||||
using DesktopMagicPluginAPI.Inputs;
|
||||
|
||||
using Microsoft.Win32;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using System.Timers;
|
||||
using System.Windows;
|
||||
using System.Windows.Interop;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
|
||||
namespace DesktopMagic
|
||||
{
|
||||
public partial class PluginWindow : Window
|
||||
{
|
||||
private readonly RegistryKey key;
|
||||
private Thread pluginThread;
|
||||
private System.Timers.Timer valueTimer;
|
||||
|
||||
private Plugin pluginClassInstance;
|
||||
|
||||
public bool IsRunning { get; private set; } = true;
|
||||
public string PluginName { get; private set; }
|
||||
public string PluginFolderPath { get; private set; }
|
||||
|
||||
public event Action PluginLoaded;
|
||||
|
||||
public event Action OnExit;
|
||||
|
||||
public PluginWindow(string pluginName)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
Window w = new()
|
||||
{
|
||||
Top = -100,
|
||||
Left = -100,
|
||||
Width = 0,
|
||||
Height = 0,
|
||||
|
||||
WindowStyle = WindowStyle.ToolWindow,
|
||||
ShowInTaskbar = false
|
||||
};
|
||||
w.Show();
|
||||
Owner = w;
|
||||
w.Hide();
|
||||
|
||||
System.Timers.Timer t = new System.Timers.Timer();
|
||||
t.Interval = 100;
|
||||
t.Elapsed += UpdateTimer_Elapsed;
|
||||
t.Start();
|
||||
|
||||
PluginName = pluginName;
|
||||
|
||||
key = Registry.CurrentUser.CreateSubKey(@"Software\" + App.AppName);
|
||||
Top = double.Parse(key.GetValue(pluginName + "WindowTop", 100).ToString());
|
||||
Left = double.Parse(key.GetValue(pluginName + "WindowLeft", 100).ToString());
|
||||
Height = double.Parse(key.GetValue(pluginName + "WindowHeight", 200).ToString());
|
||||
Width = double.Parse(key.GetValue(pluginName + "WindowWidth", 500).ToString());
|
||||
}
|
||||
|
||||
public PluginWindow(Plugin pluginClassInstance, string pluginName) : this(pluginName)
|
||||
{
|
||||
this.pluginClassInstance = pluginClassInstance;
|
||||
}
|
||||
|
||||
protected override void OnSourceInitialized(EventArgs e)
|
||||
{
|
||||
base.OnSourceInitialized(e);
|
||||
|
||||
//Set the window style to noactivate.
|
||||
WindowInteropHelper helper = new(this);
|
||||
_ = WindowPos.SetWindowLong(helper.Handle, WindowPos.GWL_EXSTYLE,
|
||||
WindowPos.GetWindowLong(helper.Handle, WindowPos.GWL_EXSTYLE) | WindowPos.WS_EX_NOACTIVATE);
|
||||
}
|
||||
|
||||
private void Window_ContentRendered(object sender, EventArgs e)
|
||||
{
|
||||
pluginThread = new Thread(() =>
|
||||
{
|
||||
LoadPlugin();
|
||||
});
|
||||
pluginThread.Start();
|
||||
}
|
||||
|
||||
public void UpdatePluginWindow()
|
||||
{
|
||||
ValueTimer_Elapsed(valueTimer, null);
|
||||
}
|
||||
|
||||
private void UpdateTimer_Elapsed(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
if (MainWindow.EditMode)
|
||||
{
|
||||
panel.Visibility = Visibility.Visible;
|
||||
WindowPos.SetIsLocked(this, false);
|
||||
tileBar.CaptionHeight = tileBar.CaptionHeight = ActualHeight - 10 < 0 ? 0 : ActualHeight - 10;
|
||||
ResizeMode = ResizeMode.CanResize;
|
||||
}
|
||||
else
|
||||
{
|
||||
panel.Visibility = Visibility.Collapsed;
|
||||
WindowPos.SetIsLocked(this, true);
|
||||
tileBar.CaptionHeight = 0;
|
||||
ResizeMode = ResizeMode.NoResize;
|
||||
}
|
||||
|
||||
if (!IsRunning)
|
||||
{
|
||||
((System.Timers.Timer)sender).Stop();
|
||||
}
|
||||
else
|
||||
{
|
||||
viewBox.Margin = new Thickness(MainWindow.Theme.Margin);
|
||||
border.Width = viewBox.ActualWidth + (MainWindow.Theme.Margin * 2);
|
||||
border.Height = viewBox.ActualHeight + (MainWindow.Theme.Margin * 2);
|
||||
rectangleGeometry.Rect = new Rect(-MainWindow.Theme.Margin, -MainWindow.Theme.Margin, border.ActualWidth, border.ActualHeight);
|
||||
border.Background = MainWindow.Theme.BackgroundBrush;
|
||||
border.CornerRadius = new CornerRadius(MainWindow.Theme.CornerRadius);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void LoadPlugin()
|
||||
{
|
||||
if (pluginClassInstance is null)
|
||||
{
|
||||
PluginFolderPath = $"{Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)}\\{App.AppName}\\Plugins\\{PluginName}";
|
||||
|
||||
if (!File.Exists($"{PluginFolderPath}\\{PluginName}.dll"))
|
||||
{
|
||||
_ = MessageBox.Show("File does not exist!", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
Exit();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
ExecuteSource();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
App.Logger.Log(ex.ToString(), "Plugin");
|
||||
_ = MessageBox.Show("File execution error:\n" + ex, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
Exit();
|
||||
return;
|
||||
}
|
||||
PluginLoaded?.Invoke();
|
||||
}
|
||||
|
||||
private void ExecuteSource()
|
||||
{
|
||||
object instance = pluginClassInstance;
|
||||
if (instance is null)
|
||||
{
|
||||
byte[] assemblyBytes = File.ReadAllBytes($"{PluginFolderPath}\\{PluginName}.dll");
|
||||
Assembly dll = Assembly.Load(assemblyBytes);
|
||||
Type instanceType = dll.GetTypes().FirstOrDefault(type => type.GetTypeInfo().BaseType == typeof(Plugin));
|
||||
|
||||
if (instanceType is null)
|
||||
{
|
||||
_ = MessageBox.Show($"The \"Plugin\" class could not be found! It has to inherit from \"{typeof(Plugin).FullName}\"", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
Exit();
|
||||
return;
|
||||
}
|
||||
|
||||
instance = Activator.CreateInstance(instanceType);
|
||||
}
|
||||
if (instance is Plugin)
|
||||
{
|
||||
pluginClassInstance = instance as Plugin;
|
||||
pluginClassInstance.Application = new PluginData(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
_ = MessageBox.Show($"The \"Plugin\" class has to inherit from \"{typeof(Plugin).FullName}\"", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
Exit();
|
||||
return;
|
||||
}
|
||||
|
||||
LoadOptions(instance);
|
||||
|
||||
valueTimer = new System.Timers.Timer();
|
||||
valueTimer.Interval = 1000;
|
||||
valueTimer.Elapsed += ValueTimer_Elapsed;
|
||||
|
||||
pluginClassInstance.Start();
|
||||
UpdatePluginWindow();
|
||||
|
||||
if (pluginClassInstance.UpdateInterval > 0)
|
||||
{
|
||||
valueTimer.Interval = pluginClassInstance.UpdateInterval;
|
||||
valueTimer.Start();
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadOptions(object instance)
|
||||
{
|
||||
try
|
||||
{
|
||||
FieldInfo[] props = instance.GetType().GetFields(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.GetField);
|
||||
|
||||
List<SettingElement> settingElements = new List<SettingElement>();
|
||||
foreach (FieldInfo prop in props)
|
||||
{
|
||||
if (prop.GetValue(instance) is Element element)
|
||||
{
|
||||
object[] attributes = prop.GetCustomAttributes(true);
|
||||
foreach (object attribute in attributes)
|
||||
{
|
||||
if (attribute is ElementAttribute elementAttribute)
|
||||
{
|
||||
settingElements.Add(new SettingElement(element, elementAttribute.Name, elementAttribute.OrderIndex));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
settingElements = settingElements.OrderBy(x => x.OrderIndex).ToList();
|
||||
if (MainWindow.PluginsSettings.ContainsKey(PluginName))
|
||||
{
|
||||
MainWindow.PluginsSettings[PluginName] = settingElements;
|
||||
}
|
||||
else
|
||||
{
|
||||
MainWindow.PluginsSettings.Add(PluginName, settingElements);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
IsRunning = false;
|
||||
App.Logger.Log(ex.ToString(), "Plugin");
|
||||
_ = MessageBox.Show("File execution error:\n" + ex, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
Exit();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private void ValueTimer_Elapsed(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (IsRunning)
|
||||
{
|
||||
Bitmap result = pluginClassInstance.Main();
|
||||
|
||||
if (pluginClassInstance.UpdateInterval > 0)
|
||||
{
|
||||
valueTimer.Interval = pluginClassInstance.UpdateInterval;
|
||||
}
|
||||
else
|
||||
{
|
||||
valueTimer.Stop();
|
||||
}
|
||||
|
||||
if (result is not null)
|
||||
{
|
||||
BitmapScalingMode renderOptions = pluginClassInstance.RenderQuality switch
|
||||
{
|
||||
RenderQuality.High => BitmapScalingMode.HighQuality,
|
||||
RenderQuality.Low => BitmapScalingMode.LowQuality,
|
||||
RenderQuality.Performance => BitmapScalingMode.NearestNeighbor,
|
||||
_ => BitmapScalingMode.Unspecified
|
||||
};
|
||||
|
||||
//Update Image
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
RenderOptions.SetBitmapScalingMode(image, renderOptions);
|
||||
image.Source = BitmapToImageSource(result);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
IsRunning = false;
|
||||
App.Logger.Log(ex.ToString(), "Plugin");
|
||||
_ = MessageBox.Show("File execution error:\n" + ex, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
Exit();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!IsRunning)
|
||||
{
|
||||
valueTimer.Stop();
|
||||
}
|
||||
}
|
||||
|
||||
private static BitmapSource BitmapToImageSource(Bitmap bitmap)
|
||||
{
|
||||
BitmapData bitmapData = bitmap.LockBits(
|
||||
new Rectangle(0, 0, bitmap.Width, bitmap.Height),
|
||||
ImageLockMode.ReadOnly, bitmap.PixelFormat);
|
||||
|
||||
BitmapSource bitmapSource = BitmapSource.Create(
|
||||
bitmapData.Width, bitmapData.Height,
|
||||
bitmap.HorizontalResolution, bitmap.VerticalResolution,
|
||||
PixelFormats.Bgra32, null,
|
||||
bitmapData.Scan0, bitmapData.Stride * bitmapData.Height, bitmapData.Stride);
|
||||
|
||||
bitmap.UnlockBits(bitmapData);
|
||||
return bitmapSource;
|
||||
}
|
||||
|
||||
public void Exit()
|
||||
{
|
||||
IsRunning = false;
|
||||
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
OnExit?.Invoke();
|
||||
});
|
||||
}
|
||||
|
||||
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
pluginClassInstance?.Stop();
|
||||
IsRunning = false;
|
||||
}
|
||||
|
||||
#region Window Events
|
||||
|
||||
private void Window_LocationChanged(object sender, EventArgs e)
|
||||
{
|
||||
key.SetValue(PluginName + "WindowTop", Top);
|
||||
key.SetValue(PluginName + "WindowLeft", Left);
|
||||
}
|
||||
|
||||
private void Window_SizeChanged(object sender, SizeChangedEventArgs e)
|
||||
{
|
||||
key.SetValue(PluginName + "WindowHeight", Height);
|
||||
key.SetValue(PluginName + "WindowWidth", Width);
|
||||
tileBar.CaptionHeight = ActualHeight - 10;
|
||||
}
|
||||
|
||||
private void Window_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
|
||||
{
|
||||
ImageSource imageSource = image.Source;
|
||||
BitmapSource bitmapImage = (BitmapSource)imageSource;
|
||||
double pixelMousePositionX = e.GetPosition(image).X * bitmapImage.PixelWidth / image.ActualHeight;
|
||||
double pixelMousePositionY = e.GetPosition(image).Y * bitmapImage.PixelHeight / image.ActualHeight;
|
||||
|
||||
MouseButton mouseButton;
|
||||
|
||||
switch (e.ChangedButton)
|
||||
{
|
||||
case System.Windows.Input.MouseButton.Left:
|
||||
mouseButton = MouseButton.Left;
|
||||
break;
|
||||
|
||||
case System.Windows.Input.MouseButton.Middle:
|
||||
mouseButton = MouseButton.Middle;
|
||||
break;
|
||||
|
||||
case System.Windows.Input.MouseButton.Right:
|
||||
mouseButton = MouseButton.Right;
|
||||
break;
|
||||
|
||||
default:
|
||||
return;
|
||||
};
|
||||
|
||||
System.Drawing.Point point = new System.Drawing.Point((int)pixelMousePositionX, (int)pixelMousePositionY);
|
||||
pluginClassInstance.OnMouseClick(point, mouseButton);
|
||||
}
|
||||
|
||||
private void Window_MouseMove(object sender, System.Windows.Input.MouseEventArgs e)
|
||||
{
|
||||
ImageSource imageSource = image.Source;
|
||||
BitmapSource bitmapImage = (BitmapSource)imageSource;
|
||||
double pixelMousePositionX = e.GetPosition(image).X * bitmapImage.PixelWidth / image.ActualHeight;
|
||||
double pixelMousePositionY = e.GetPosition(image).Y * bitmapImage.PixelHeight / image.ActualHeight;
|
||||
|
||||
System.Drawing.Point point = new System.Drawing.Point((int)pixelMousePositionX, (int)pixelMousePositionY);
|
||||
pluginClassInstance.OnMouseMove(point);
|
||||
}
|
||||
|
||||
private void Window_MouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e)
|
||||
{
|
||||
ImageSource imageSource = image.Source;
|
||||
BitmapSource bitmapImage = (BitmapSource)imageSource;
|
||||
double pixelMousePositionX = e.GetPosition(image).X * bitmapImage.PixelWidth / image.ActualHeight;
|
||||
double pixelMousePositionY = e.GetPosition(image).Y * bitmapImage.PixelHeight / image.ActualHeight;
|
||||
|
||||
System.Drawing.Point point = new System.Drawing.Point((int)pixelMousePositionX, (int)pixelMousePositionY);
|
||||
pluginClassInstance.OnMouseWheel(point, e.Delta);
|
||||
}
|
||||
|
||||
#endregion Window Events
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using DesktopMagicPluginAPI.Inputs;
|
||||
|
||||
namespace DesktopMagic.Plugins
|
||||
{
|
||||
internal class SettingElement
|
||||
{
|
||||
public Element Element { get; }
|
||||
public string Name { get; }
|
||||
public int OrderIndex { get; }
|
||||
|
||||
public SettingElement(Element element, string name, int orderIndex)
|
||||
{
|
||||
Element = element;
|
||||
Name = name;
|
||||
OrderIndex = orderIndex;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using DesktopMagicPluginAPI;
|
||||
|
||||
using System.Drawing;
|
||||
|
||||
namespace DesktopMagic.Plugins
|
||||
{
|
||||
internal class Theme : ITheme
|
||||
{
|
||||
public Color PrimaryColor { get; set; } = Color.White;
|
||||
public Color SecondaryColor { get; set; } = Color.White;
|
||||
public Color BackgroundColor { get; set; } = Color.Transparent;
|
||||
|
||||
public string Font { get; set; } = "Segoe UI";
|
||||
public int CornerRadius { get; set; }
|
||||
public int Margin { get; set; }
|
||||
|
||||
public System.Windows.Media.Brush PrimaryBrush { get; set; } = System.Windows.Media.Brushes.White;
|
||||
public System.Windows.Media.Brush SecondaryBrush { get; set; } = System.Windows.Media.Brushes.White;
|
||||
public System.Windows.Media.Brush BackgroundBrush { get; set; } = System.Windows.Media.Brushes.Transparent;
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 137 KiB After Width: | Height: | Size: 137 KiB |
|
Before Width: | Height: | Size: 137 KiB After Width: | Height: | Size: 137 KiB |
@@ -0,0 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="System.Drawing.Common" Version="5.0.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\DesktopMagicPluginAPI\DesktopMagicPluginAPI.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,39 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<Company>Stone_Red</Company>
|
||||
<Product>Stone_Red</Product>
|
||||
<Version>0.0.0.5</Version>
|
||||
<RepositoryUrl>https://github.com/Stone-Red-Code/DesktopMagic</RepositoryUrl>
|
||||
<PackageLicenseFile>LICENSE</PackageLicenseFile>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<AssemblyVersion>0.0.0.5</AssemblyVersion>
|
||||
<PackageProjectUrl></PackageProjectUrl>
|
||||
<FileVersion>0.0.0.5</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">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="..\..\LICENSE">
|
||||
<Pack>True</Pack>
|
||||
<PackagePath></PackagePath>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,888 @@
|
||||
<a name='assembly'></a>
|
||||
# DesktopMagicPluginAPI
|
||||
|
||||
## Contents
|
||||
|
||||
- [Button](#T-DesktopMagicPluginAPI-Inputs-Button 'DesktopMagicPluginAPI.Inputs.Button')
|
||||
- [#ctor(value)](#M-DesktopMagicPluginAPI-Inputs-Button-#ctor-System-String- 'DesktopMagicPluginAPI.Inputs.Button.#ctor(System.String)')
|
||||
- [Value](#P-DesktopMagicPluginAPI-Inputs-Button-Value 'DesktopMagicPluginAPI.Inputs.Button.Value')
|
||||
- [Click()](#M-DesktopMagicPluginAPI-Inputs-Button-Click 'DesktopMagicPluginAPI.Inputs.Button.Click')
|
||||
- [CheckBox](#T-DesktopMagicPluginAPI-Inputs-CheckBox 'DesktopMagicPluginAPI.Inputs.CheckBox')
|
||||
- [#ctor(value)](#M-DesktopMagicPluginAPI-Inputs-CheckBox-#ctor-System-Boolean- 'DesktopMagicPluginAPI.Inputs.CheckBox.#ctor(System.Boolean)')
|
||||
- [Value](#P-DesktopMagicPluginAPI-Inputs-CheckBox-Value 'DesktopMagicPluginAPI.Inputs.CheckBox.Value')
|
||||
- [ComboBox](#T-DesktopMagicPluginAPI-Inputs-ComboBox 'DesktopMagicPluginAPI.Inputs.ComboBox')
|
||||
- [#ctor(items)](#M-DesktopMagicPluginAPI-Inputs-ComboBox-#ctor-System-String[]- 'DesktopMagicPluginAPI.Inputs.ComboBox.#ctor(System.String[])')
|
||||
- [Items](#P-DesktopMagicPluginAPI-Inputs-ComboBox-Items 'DesktopMagicPluginAPI.Inputs.ComboBox.Items')
|
||||
- [Value](#P-DesktopMagicPluginAPI-Inputs-ComboBox-Value 'DesktopMagicPluginAPI.Inputs.ComboBox.Value')
|
||||
- [Element](#T-DesktopMagicPluginAPI-Inputs-Element 'DesktopMagicPluginAPI.Inputs.Element')
|
||||
- [ValueChanged()](#M-DesktopMagicPluginAPI-Inputs-Element-ValueChanged 'DesktopMagicPluginAPI.Inputs.Element.ValueChanged')
|
||||
- [ElementAttribute](#T-DesktopMagicPluginAPI-Inputs-ElementAttribute 'DesktopMagicPluginAPI.Inputs.ElementAttribute')
|
||||
- [#ctor(name,orderIndex)](#M-DesktopMagicPluginAPI-Inputs-ElementAttribute-#ctor-System-String,System-Int32- 'DesktopMagicPluginAPI.Inputs.ElementAttribute.#ctor(System.String,System.Int32)')
|
||||
- [#ctor(orderIndex)](#M-DesktopMagicPluginAPI-Inputs-ElementAttribute-#ctor-System-Int32- 'DesktopMagicPluginAPI.Inputs.ElementAttribute.#ctor(System.Int32)')
|
||||
- [#ctor()](#M-DesktopMagicPluginAPI-Inputs-ElementAttribute-#ctor 'DesktopMagicPluginAPI.Inputs.ElementAttribute.#ctor')
|
||||
- [Name](#P-DesktopMagicPluginAPI-Inputs-ElementAttribute-Name 'DesktopMagicPluginAPI.Inputs.ElementAttribute.Name')
|
||||
- [OrderIndex](#P-DesktopMagicPluginAPI-Inputs-ElementAttribute-OrderIndex 'DesktopMagicPluginAPI.Inputs.ElementAttribute.OrderIndex')
|
||||
- [GraphicsExtentions](#T-DesktopMagicPluginAPI-Drawing-GraphicsExtentions 'DesktopMagicPluginAPI.Drawing.GraphicsExtentions')
|
||||
- [DrawStringFixedWidth(graphics,s,font,brush,x,y,width)](#M-DesktopMagicPluginAPI-Drawing-GraphicsExtentions-DrawStringFixedWidth-System-Drawing-Graphics,System-String,System-Drawing-Font,System-Drawing-Brush,System-Single,System-Single,System-Single- 'DesktopMagicPluginAPI.Drawing.GraphicsExtentions.DrawStringFixedWidth(System.Drawing.Graphics,System.String,System.Drawing.Font,System.Drawing.Brush,System.Single,System.Single,System.Single)')
|
||||
- [DrawStringFixedWidth(graphics,s,font,brush,point,width)](#M-DesktopMagicPluginAPI-Drawing-GraphicsExtentions-DrawStringFixedWidth-System-Drawing-Graphics,System-String,System-Drawing-Font,System-Drawing-Brush,System-Drawing-PointF,System-Single- 'DesktopMagicPluginAPI.Drawing.GraphicsExtentions.DrawStringFixedWidth(System.Drawing.Graphics,System.String,System.Drawing.Font,System.Drawing.Brush,System.Drawing.PointF,System.Single)')
|
||||
- [DrawStringMonospace(graphics,s,font,brush,x,y)](#M-DesktopMagicPluginAPI-Drawing-GraphicsExtentions-DrawStringMonospace-System-Drawing-Graphics,System-String,System-Drawing-Font,System-Drawing-Brush,System-Single,System-Single- 'DesktopMagicPluginAPI.Drawing.GraphicsExtentions.DrawStringMonospace(System.Drawing.Graphics,System.String,System.Drawing.Font,System.Drawing.Brush,System.Single,System.Single)')
|
||||
- [DrawStringMonospace(graphics,s,font,brush,point)](#M-DesktopMagicPluginAPI-Drawing-GraphicsExtentions-DrawStringMonospace-System-Drawing-Graphics,System-String,System-Drawing-Font,System-Drawing-Brush,System-Drawing-PointF- 'DesktopMagicPluginAPI.Drawing.GraphicsExtentions.DrawStringMonospace(System.Drawing.Graphics,System.String,System.Drawing.Font,System.Drawing.Brush,System.Drawing.PointF)')
|
||||
- [DrawStringNoLeftPadding(graphics,s,font,brush,x,y)](#M-DesktopMagicPluginAPI-Drawing-GraphicsExtentions-DrawStringNoLeftPadding-System-Drawing-Graphics,System-String,System-Drawing-Font,System-Drawing-Brush,System-Single,System-Single- 'DesktopMagicPluginAPI.Drawing.GraphicsExtentions.DrawStringNoLeftPadding(System.Drawing.Graphics,System.String,System.Drawing.Font,System.Drawing.Brush,System.Single,System.Single)')
|
||||
- [DrawStringNoLeftPadding(graphics,s,font,brush,point)](#M-DesktopMagicPluginAPI-Drawing-GraphicsExtentions-DrawStringNoLeftPadding-System-Drawing-Graphics,System-String,System-Drawing-Font,System-Drawing-Brush,System-Drawing-PointF- 'DesktopMagicPluginAPI.Drawing.GraphicsExtentions.DrawStringNoLeftPadding(System.Drawing.Graphics,System.String,System.Drawing.Font,System.Drawing.Brush,System.Drawing.PointF)')
|
||||
- [MeasureStringNoLeftPadding(graphics,text,font)](#M-DesktopMagicPluginAPI-Drawing-GraphicsExtentions-MeasureStringNoLeftPadding-System-Drawing-Graphics,System-String,System-Drawing-Font- 'DesktopMagicPluginAPI.Drawing.GraphicsExtentions.MeasureStringNoLeftPadding(System.Drawing.Graphics,System.String,System.Drawing.Font)')
|
||||
- [IPluginData](#T-DesktopMagicPluginAPI-IPluginData 'DesktopMagicPluginAPI.IPluginData')
|
||||
- [Color](#P-DesktopMagicPluginAPI-IPluginData-Color 'DesktopMagicPluginAPI.IPluginData.Color')
|
||||
- [Font](#P-DesktopMagicPluginAPI-IPluginData-Font 'DesktopMagicPluginAPI.IPluginData.Font')
|
||||
- [PluginName](#P-DesktopMagicPluginAPI-IPluginData-PluginName 'DesktopMagicPluginAPI.IPluginData.PluginName')
|
||||
- [PluginPath](#P-DesktopMagicPluginAPI-IPluginData-PluginPath 'DesktopMagicPluginAPI.IPluginData.PluginPath')
|
||||
- [Theme](#P-DesktopMagicPluginAPI-IPluginData-Theme 'DesktopMagicPluginAPI.IPluginData.Theme')
|
||||
- [WindowPosition](#P-DesktopMagicPluginAPI-IPluginData-WindowPosition 'DesktopMagicPluginAPI.IPluginData.WindowPosition')
|
||||
- [WindowSize](#P-DesktopMagicPluginAPI-IPluginData-WindowSize 'DesktopMagicPluginAPI.IPluginData.WindowSize')
|
||||
- [UpdateWindow()](#M-DesktopMagicPluginAPI-IPluginData-UpdateWindow 'DesktopMagicPluginAPI.IPluginData.UpdateWindow')
|
||||
- [ITheme](#T-DesktopMagicPluginAPI-ITheme 'DesktopMagicPluginAPI.ITheme')
|
||||
- [BackgroundColor](#P-DesktopMagicPluginAPI-ITheme-BackgroundColor 'DesktopMagicPluginAPI.ITheme.BackgroundColor')
|
||||
- [CornerRadius](#P-DesktopMagicPluginAPI-ITheme-CornerRadius 'DesktopMagicPluginAPI.ITheme.CornerRadius')
|
||||
- [Font](#P-DesktopMagicPluginAPI-ITheme-Font 'DesktopMagicPluginAPI.ITheme.Font')
|
||||
- [Margin](#P-DesktopMagicPluginAPI-ITheme-Margin 'DesktopMagicPluginAPI.ITheme.Margin')
|
||||
- [PrimaryColor](#P-DesktopMagicPluginAPI-ITheme-PrimaryColor 'DesktopMagicPluginAPI.ITheme.PrimaryColor')
|
||||
- [SecondaryColor](#P-DesktopMagicPluginAPI-ITheme-SecondaryColor 'DesktopMagicPluginAPI.ITheme.SecondaryColor')
|
||||
- [IntegerUpDown](#T-DesktopMagicPluginAPI-Inputs-IntegerUpDown 'DesktopMagicPluginAPI.Inputs.IntegerUpDown')
|
||||
- [#ctor(min,max,value)](#M-DesktopMagicPluginAPI-Inputs-IntegerUpDown-#ctor-System-Int32,System-Int32,System-Int32- 'DesktopMagicPluginAPI.Inputs.IntegerUpDown.#ctor(System.Int32,System.Int32,System.Int32)')
|
||||
- [Maximum](#P-DesktopMagicPluginAPI-Inputs-IntegerUpDown-Maximum 'DesktopMagicPluginAPI.Inputs.IntegerUpDown.Maximum')
|
||||
- [Minimum](#P-DesktopMagicPluginAPI-Inputs-IntegerUpDown-Minimum 'DesktopMagicPluginAPI.Inputs.IntegerUpDown.Minimum')
|
||||
- [Value](#P-DesktopMagicPluginAPI-Inputs-IntegerUpDown-Value 'DesktopMagicPluginAPI.Inputs.IntegerUpDown.Value')
|
||||
- [Label](#T-DesktopMagicPluginAPI-Inputs-Label 'DesktopMagicPluginAPI.Inputs.Label')
|
||||
- [#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')
|
||||
- [RenderQuality](#P-DesktopMagicPluginAPI-Plugin-RenderQuality 'DesktopMagicPluginAPI.Plugin.RenderQuality')
|
||||
- [UpdateInterval](#P-DesktopMagicPluginAPI-Plugin-UpdateInterval 'DesktopMagicPluginAPI.Plugin.UpdateInterval')
|
||||
- [Main()](#M-DesktopMagicPluginAPI-Plugin-Main 'DesktopMagicPluginAPI.Plugin.Main')
|
||||
- [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)')
|
||||
- [OnMouseWheel(position,delta)](#M-DesktopMagicPluginAPI-Plugin-OnMouseWheel-System-Drawing-Point,System-Int32- 'DesktopMagicPluginAPI.Plugin.OnMouseWheel(System.Drawing.Point,System.Int32)')
|
||||
- [Start()](#M-DesktopMagicPluginAPI-Plugin-Start 'DesktopMagicPluginAPI.Plugin.Start')
|
||||
- [Stop()](#M-DesktopMagicPluginAPI-Plugin-Stop 'DesktopMagicPluginAPI.Plugin.Stop')
|
||||
- [RenderQuality](#T-DesktopMagicPluginAPI-Drawing-RenderQuality 'DesktopMagicPluginAPI.Drawing.RenderQuality')
|
||||
- [High](#F-DesktopMagicPluginAPI-Drawing-RenderQuality-High 'DesktopMagicPluginAPI.Drawing.RenderQuality.High')
|
||||
- [Low](#F-DesktopMagicPluginAPI-Drawing-RenderQuality-Low 'DesktopMagicPluginAPI.Drawing.RenderQuality.Low')
|
||||
- [Performance](#F-DesktopMagicPluginAPI-Drawing-RenderQuality-Performance 'DesktopMagicPluginAPI.Drawing.RenderQuality.Performance')
|
||||
- [Slider](#T-DesktopMagicPluginAPI-Inputs-Slider 'DesktopMagicPluginAPI.Inputs.Slider')
|
||||
- [#ctor(min,max,value)](#M-DesktopMagicPluginAPI-Inputs-Slider-#ctor-System-Double,System-Double,System-Double- 'DesktopMagicPluginAPI.Inputs.Slider.#ctor(System.Double,System.Double,System.Double)')
|
||||
- [Maximum](#P-DesktopMagicPluginAPI-Inputs-Slider-Maximum 'DesktopMagicPluginAPI.Inputs.Slider.Maximum')
|
||||
- [Minimum](#P-DesktopMagicPluginAPI-Inputs-Slider-Minimum 'DesktopMagicPluginAPI.Inputs.Slider.Minimum')
|
||||
- [Value](#P-DesktopMagicPluginAPI-Inputs-Slider-Value 'DesktopMagicPluginAPI.Inputs.Slider.Value')
|
||||
- [TextBox](#T-DesktopMagicPluginAPI-Inputs-TextBox 'DesktopMagicPluginAPI.Inputs.TextBox')
|
||||
- [#ctor(value)](#M-DesktopMagicPluginAPI-Inputs-TextBox-#ctor-System-String- 'DesktopMagicPluginAPI.Inputs.TextBox.#ctor(System.String)')
|
||||
- [Value](#P-DesktopMagicPluginAPI-Inputs-TextBox-Value 'DesktopMagicPluginAPI.Inputs.TextBox.Value')
|
||||
|
||||
<a name='T-DesktopMagicPluginAPI-Inputs-Button'></a>
|
||||
## Button `type`
|
||||
|
||||
##### Namespace
|
||||
|
||||
DesktopMagicPluginAPI.Inputs
|
||||
|
||||
##### Summary
|
||||
|
||||
Represents a button control.
|
||||
|
||||
<a name='M-DesktopMagicPluginAPI-Inputs-Button-#ctor-System-String-'></a>
|
||||
### #ctor(value) `constructor`
|
||||
|
||||
##### Summary
|
||||
|
||||
Initializes a new instance of the [Button](#T-DesktopMagicPluginAPI-Inputs-Button 'DesktopMagicPluginAPI.Inputs.Button') class with the provided `value`.
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| value | [System.String](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.String 'System.String') | The text caption displayed in the [Button](#T-DesktopMagicPluginAPI-Inputs-Button 'DesktopMagicPluginAPI.Inputs.Button') control. |
|
||||
|
||||
<a name='P-DesktopMagicPluginAPI-Inputs-Button-Value'></a>
|
||||
### Value `property`
|
||||
|
||||
##### Summary
|
||||
|
||||
Gets or sets the text caption displayed in the [Button](#T-DesktopMagicPluginAPI-Inputs-Button 'DesktopMagicPluginAPI.Inputs.Button') element.
|
||||
|
||||
<a name='M-DesktopMagicPluginAPI-Inputs-Button-Click'></a>
|
||||
### Click() `method`
|
||||
|
||||
##### Summary
|
||||
|
||||
Triggers the [](#E-DesktopMagicPluginAPI-Inputs-Button-OnClick 'DesktopMagicPluginAPI.Inputs.Button.OnClick') event.
|
||||
|
||||
##### Parameters
|
||||
|
||||
This method has no parameters.
|
||||
|
||||
<a name='T-DesktopMagicPluginAPI-Inputs-CheckBox'></a>
|
||||
## CheckBox `type`
|
||||
|
||||
##### Namespace
|
||||
|
||||
DesktopMagicPluginAPI.Inputs
|
||||
|
||||
##### Summary
|
||||
|
||||
Represents a check box control.
|
||||
|
||||
<a name='M-DesktopMagicPluginAPI-Inputs-CheckBox-#ctor-System-Boolean-'></a>
|
||||
### #ctor(value) `constructor`
|
||||
|
||||
##### Summary
|
||||
|
||||
Initializes a new instance of the [CheckBox](#T-DesktopMagicPluginAPI-Inputs-CheckBox 'DesktopMagicPluginAPI.Inputs.CheckBox') class with the provided `value`.
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| value | [System.Boolean](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Boolean 'System.Boolean') | A value indicating whether the [CheckBox](#T-DesktopMagicPluginAPI-Inputs-CheckBox 'DesktopMagicPluginAPI.Inputs.CheckBox') is in the checked state. |
|
||||
|
||||
<a name='P-DesktopMagicPluginAPI-Inputs-CheckBox-Value'></a>
|
||||
### Value `property`
|
||||
|
||||
##### Summary
|
||||
|
||||
Gets or set a value indicating whether the [CheckBox](#T-DesktopMagicPluginAPI-Inputs-CheckBox 'DesktopMagicPluginAPI.Inputs.CheckBox') is in the checked state.
|
||||
|
||||
<a name='T-DesktopMagicPluginAPI-Inputs-ComboBox'></a>
|
||||
## ComboBox `type`
|
||||
|
||||
##### Namespace
|
||||
|
||||
DesktopMagicPluginAPI.Inputs
|
||||
|
||||
##### Summary
|
||||
|
||||
Represents a selection control with a drop-down list.
|
||||
|
||||
<a name='M-DesktopMagicPluginAPI-Inputs-ComboBox-#ctor-System-String[]-'></a>
|
||||
### #ctor(items) `constructor`
|
||||
|
||||
##### Summary
|
||||
|
||||
Initializes a new instance of the [Label](#T-DesktopMagicPluginAPI-Inputs-Label 'DesktopMagicPluginAPI.Inputs.Label') class with the provided `items`.
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| items | [System.String[]](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.String[] 'System.String[]') | |
|
||||
|
||||
<a name='P-DesktopMagicPluginAPI-Inputs-ComboBox-Items'></a>
|
||||
### Items `property`
|
||||
|
||||
##### Summary
|
||||
|
||||
Gets the collection used to generate the content of the [ComboBox](#T-DesktopMagicPluginAPI-Inputs-ComboBox 'DesktopMagicPluginAPI.Inputs.ComboBox').
|
||||
|
||||
<a name='P-DesktopMagicPluginAPI-Inputs-ComboBox-Value'></a>
|
||||
### Value `property`
|
||||
|
||||
##### Summary
|
||||
|
||||
Gets the currently selected item associated with this [ComboBox](#T-DesktopMagicPluginAPI-Inputs-ComboBox 'DesktopMagicPluginAPI.Inputs.ComboBox').
|
||||
|
||||
##### Remarks
|
||||
|
||||
If you assign a value to this property, the displayed text in the user interface will not be changed.
|
||||
|
||||
<a name='T-DesktopMagicPluginAPI-Inputs-Element'></a>
|
||||
## Element `type`
|
||||
|
||||
##### Namespace
|
||||
|
||||
DesktopMagicPluginAPI.Inputs
|
||||
|
||||
##### Summary
|
||||
|
||||
The element base class.
|
||||
|
||||
<a name='M-DesktopMagicPluginAPI-Inputs-Element-ValueChanged'></a>
|
||||
### ValueChanged() `method`
|
||||
|
||||
##### Summary
|
||||
|
||||
Triggers the [](#E-DesktopMagicPluginAPI-Inputs-Element-OnValueChanged 'DesktopMagicPluginAPI.Inputs.Element.OnValueChanged') event.
|
||||
|
||||
##### Parameters
|
||||
|
||||
This method has no parameters.
|
||||
|
||||
<a name='T-DesktopMagicPluginAPI-Inputs-ElementAttribute'></a>
|
||||
## ElementAttribute `type`
|
||||
|
||||
##### Namespace
|
||||
|
||||
DesktopMagicPluginAPI.Inputs
|
||||
|
||||
##### Summary
|
||||
|
||||
Marks a Property as element.
|
||||
|
||||
<a name='M-DesktopMagicPluginAPI-Inputs-ElementAttribute-#ctor-System-String,System-Int32-'></a>
|
||||
### #ctor(name,orderIndex) `constructor`
|
||||
|
||||
##### Summary
|
||||
|
||||
Marks a Property as element with the provided `name` and `orderIndex`.
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| name | [System.String](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.String 'System.String') | The name of the element. |
|
||||
| orderIndex | [System.Int32](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Int32 'System.Int32') | The order index of the element. |
|
||||
|
||||
<a name='M-DesktopMagicPluginAPI-Inputs-ElementAttribute-#ctor-System-Int32-'></a>
|
||||
### #ctor(orderIndex) `constructor`
|
||||
|
||||
##### Summary
|
||||
|
||||
Marks a Property as element with the provided `orderIndex`.
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| orderIndex | [System.Int32](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Int32 'System.Int32') | The order index of the element. |
|
||||
|
||||
<a name='M-DesktopMagicPluginAPI-Inputs-ElementAttribute-#ctor'></a>
|
||||
### #ctor() `constructor`
|
||||
|
||||
##### Summary
|
||||
|
||||
*Inherit from parent.*
|
||||
|
||||
##### Parameters
|
||||
|
||||
This constructor has no parameters.
|
||||
|
||||
<a name='P-DesktopMagicPluginAPI-Inputs-ElementAttribute-Name'></a>
|
||||
### Name `property`
|
||||
|
||||
##### Summary
|
||||
|
||||
The name of the element.
|
||||
|
||||
<a name='P-DesktopMagicPluginAPI-Inputs-ElementAttribute-OrderIndex'></a>
|
||||
### OrderIndex `property`
|
||||
|
||||
##### Summary
|
||||
|
||||
The order index of the element.
|
||||
|
||||
<a name='T-DesktopMagicPluginAPI-Drawing-GraphicsExtentions'></a>
|
||||
## GraphicsExtentions `type`
|
||||
|
||||
##### Namespace
|
||||
|
||||
DesktopMagicPluginAPI.Drawing
|
||||
|
||||
##### Summary
|
||||
|
||||
Extensions for the [Graphics](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Graphics 'System.Drawing.Graphics') class.
|
||||
|
||||
<a name='M-DesktopMagicPluginAPI-Drawing-GraphicsExtentions-DrawStringFixedWidth-System-Drawing-Graphics,System-String,System-Drawing-Font,System-Drawing-Brush,System-Single,System-Single,System-Single-'></a>
|
||||
### DrawStringFixedWidth(graphics,s,font,brush,x,y,width) `method`
|
||||
|
||||
##### Summary
|
||||
|
||||
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| graphics | [System.Drawing.Graphics](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Graphics 'System.Drawing.Graphics') | Graphics object. |
|
||||
| s | [System.String](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.String 'System.String') | String to draw. |
|
||||
| font | [System.Drawing.Font](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Font 'System.Drawing.Font') | [Font](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Font 'System.Drawing.Font') that defines the text format of the string. |
|
||||
| brush | [System.Drawing.Brush](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Brush 'System.Drawing.Brush') | [Brush](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Brush 'System.Drawing.Brush') that determines the color and texture of the drawn text. |
|
||||
| x | [System.Single](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Single 'System.Single') | The x-coordinate of the upper-left corner of the drawn text. |
|
||||
| y | [System.Single](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Single 'System.Single') | The y-coordinate of the upper-left corner of the drawn text. |
|
||||
| width | [System.Single](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Single 'System.Single') | The specified width. |
|
||||
|
||||
<a name='M-DesktopMagicPluginAPI-Drawing-GraphicsExtentions-DrawStringFixedWidth-System-Drawing-Graphics,System-String,System-Drawing-Font,System-Drawing-Brush,System-Drawing-PointF,System-Single-'></a>
|
||||
### DrawStringFixedWidth(graphics,s,font,brush,point,width) `method`
|
||||
|
||||
##### Summary
|
||||
|
||||
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| graphics | [System.Drawing.Graphics](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Graphics 'System.Drawing.Graphics') | Graphics object. |
|
||||
| s | [System.String](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.String 'System.String') | String to draw. |
|
||||
| font | [System.Drawing.Font](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Font 'System.Drawing.Font') | [Font](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Font 'System.Drawing.Font') that defines the text format of the string. |
|
||||
| brush | [System.Drawing.Brush](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Brush 'System.Drawing.Brush') | [Brush](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Brush 'System.Drawing.Brush') that determines the color and texture of the drawn text. |
|
||||
| point | [System.Drawing.PointF](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.PointF 'System.Drawing.PointF') | [PointF](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.PointF 'System.Drawing.PointF') structure that specifies the upper-left corner of the drawn text. |
|
||||
| width | [System.Single](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Single 'System.Single') | The specified width. |
|
||||
|
||||
<a name='M-DesktopMagicPluginAPI-Drawing-GraphicsExtentions-DrawStringMonospace-System-Drawing-Graphics,System-String,System-Drawing-Font,System-Drawing-Brush,System-Single,System-Single-'></a>
|
||||
### DrawStringMonospace(graphics,s,font,brush,x,y) `method`
|
||||
|
||||
##### Summary
|
||||
|
||||
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| graphics | [System.Drawing.Graphics](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Graphics 'System.Drawing.Graphics') | Graphics object. |
|
||||
| s | [System.String](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.String 'System.String') | String to draw. |
|
||||
| font | [System.Drawing.Font](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Font 'System.Drawing.Font') | [Font](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Font 'System.Drawing.Font') that defines the text format of the string. |
|
||||
| brush | [System.Drawing.Brush](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Brush 'System.Drawing.Brush') | [Brush](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Brush 'System.Drawing.Brush') that determines the color and texture of the drawn text. |
|
||||
| x | [System.Single](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Single 'System.Single') | The x-coordinate of the upper-left corner of the drawn text. |
|
||||
| y | [System.Single](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Single 'System.Single') | The y-coordinate of the upper-left corner of the drawn text. |
|
||||
|
||||
<a name='M-DesktopMagicPluginAPI-Drawing-GraphicsExtentions-DrawStringMonospace-System-Drawing-Graphics,System-String,System-Drawing-Font,System-Drawing-Brush,System-Drawing-PointF-'></a>
|
||||
### DrawStringMonospace(graphics,s,font,brush,point) `method`
|
||||
|
||||
##### Summary
|
||||
|
||||
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| graphics | [System.Drawing.Graphics](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Graphics 'System.Drawing.Graphics') | Graphics object. |
|
||||
| s | [System.String](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.String 'System.String') | String to draw. |
|
||||
| font | [System.Drawing.Font](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Font 'System.Drawing.Font') | [Font](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Font 'System.Drawing.Font') that defines the text format of the string. |
|
||||
| brush | [System.Drawing.Brush](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Brush 'System.Drawing.Brush') | [Brush](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Brush 'System.Drawing.Brush') that determines the color and texture of the drawn text. |
|
||||
| point | [System.Drawing.PointF](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.PointF 'System.Drawing.PointF') | [PointF](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.PointF 'System.Drawing.PointF') structure that specifies the upper-left corner of the drawn text. |
|
||||
|
||||
<a name='M-DesktopMagicPluginAPI-Drawing-GraphicsExtentions-DrawStringNoLeftPadding-System-Drawing-Graphics,System-String,System-Drawing-Font,System-Drawing-Brush,System-Single,System-Single-'></a>
|
||||
### DrawStringNoLeftPadding(graphics,s,font,brush,x,y) `method`
|
||||
|
||||
##### Summary
|
||||
|
||||
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| graphics | [System.Drawing.Graphics](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Graphics 'System.Drawing.Graphics') | Graphics object. |
|
||||
| s | [System.String](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.String 'System.String') | String to draw. |
|
||||
| font | [System.Drawing.Font](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Font 'System.Drawing.Font') | [Font](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Font 'System.Drawing.Font') that defines the text format of the string. |
|
||||
| brush | [System.Drawing.Brush](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Brush 'System.Drawing.Brush') | [Brush](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Brush 'System.Drawing.Brush') that determines the color and texture of the drawn text. |
|
||||
| x | [System.Single](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Single 'System.Single') | The x-coordinate of the upper-left corner of the drawn text. |
|
||||
| y | [System.Single](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Single 'System.Single') | The y-coordinate of the upper-left corner of the drawn text. |
|
||||
|
||||
<a name='M-DesktopMagicPluginAPI-Drawing-GraphicsExtentions-DrawStringNoLeftPadding-System-Drawing-Graphics,System-String,System-Drawing-Font,System-Drawing-Brush,System-Drawing-PointF-'></a>
|
||||
### DrawStringNoLeftPadding(graphics,s,font,brush,point) `method`
|
||||
|
||||
##### Summary
|
||||
|
||||
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| graphics | [System.Drawing.Graphics](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Graphics 'System.Drawing.Graphics') | Graphics object. |
|
||||
| s | [System.String](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.String 'System.String') | String to draw. |
|
||||
| font | [System.Drawing.Font](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Font 'System.Drawing.Font') | [Font](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Font 'System.Drawing.Font') that defines the text format of the string. |
|
||||
| brush | [System.Drawing.Brush](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Brush 'System.Drawing.Brush') | [Brush](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Brush 'System.Drawing.Brush') that determines the color and texture of the drawn text. |
|
||||
| point | [System.Drawing.PointF](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.PointF 'System.Drawing.PointF') | [PointF](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.PointF 'System.Drawing.PointF') structure that specifies the upper-left corner of the drawn text. |
|
||||
|
||||
<a name='M-DesktopMagicPluginAPI-Drawing-GraphicsExtentions-MeasureStringNoLeftPadding-System-Drawing-Graphics,System-String,System-Drawing-Font-'></a>
|
||||
### MeasureStringNoLeftPadding(graphics,text,font) `method`
|
||||
|
||||
##### Summary
|
||||
|
||||
|
||||
|
||||
##### Returns
|
||||
|
||||
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| graphics | [System.Drawing.Graphics](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Graphics 'System.Drawing.Graphics') | Graphics object. |
|
||||
| text | [System.String](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.String 'System.String') | String to measure. |
|
||||
| font | [System.Drawing.Font](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Font 'System.Drawing.Font') | [Font](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Drawing.Font 'System.Drawing.Font') that defines the text format of the string. |
|
||||
|
||||
<a name='T-DesktopMagicPluginAPI-IPluginData'></a>
|
||||
## IPluginData `type`
|
||||
|
||||
##### Namespace
|
||||
|
||||
DesktopMagicPluginAPI
|
||||
|
||||
##### Summary
|
||||
|
||||
Defines properties and methods that provide information about the main application.
|
||||
|
||||
<a name='P-DesktopMagicPluginAPI-IPluginData-Color'></a>
|
||||
### Color `property`
|
||||
|
||||
##### Summary
|
||||
|
||||
Gets the current color of the current theme.
|
||||
|
||||
<a name='P-DesktopMagicPluginAPI-IPluginData-Font'></a>
|
||||
### Font `property`
|
||||
|
||||
##### Summary
|
||||
|
||||
Gets the current font of the current theme.
|
||||
|
||||
<a name='P-DesktopMagicPluginAPI-IPluginData-PluginName'></a>
|
||||
### PluginName `property`
|
||||
|
||||
##### Summary
|
||||
|
||||
Gets the name of the plugin.
|
||||
|
||||
<a name='P-DesktopMagicPluginAPI-IPluginData-PluginPath'></a>
|
||||
### PluginPath `property`
|
||||
|
||||
##### Summary
|
||||
|
||||
Gets the path of the parent directory of the plugin.
|
||||
|
||||
<a name='P-DesktopMagicPluginAPI-IPluginData-Theme'></a>
|
||||
### Theme `property`
|
||||
|
||||
##### Summary
|
||||
|
||||
Gets the current theme setting of the main application.
|
||||
|
||||
<a name='P-DesktopMagicPluginAPI-IPluginData-WindowPosition'></a>
|
||||
### WindowPosition `property`
|
||||
|
||||
##### Summary
|
||||
|
||||
Gets the window position of the plugin window.
|
||||
|
||||
<a name='P-DesktopMagicPluginAPI-IPluginData-WindowSize'></a>
|
||||
### WindowSize `property`
|
||||
|
||||
##### Summary
|
||||
|
||||
Gets the window size of the plugin window.
|
||||
|
||||
<a name='M-DesktopMagicPluginAPI-IPluginData-UpdateWindow'></a>
|
||||
### UpdateWindow() `method`
|
||||
|
||||
##### Summary
|
||||
|
||||
Updates the plugin window.
|
||||
|
||||
##### Parameters
|
||||
|
||||
This method has no parameters.
|
||||
|
||||
<a name='T-DesktopMagicPluginAPI-ITheme'></a>
|
||||
## ITheme `type`
|
||||
|
||||
##### Namespace
|
||||
|
||||
DesktopMagicPluginAPI
|
||||
|
||||
##### Summary
|
||||
|
||||
The theme settings of the main application.
|
||||
|
||||
<a name='P-DesktopMagicPluginAPI-ITheme-BackgroundColor'></a>
|
||||
### BackgroundColor `property`
|
||||
|
||||
##### Summary
|
||||
|
||||
Gets the background color of the current theme.
|
||||
|
||||
<a name='P-DesktopMagicPluginAPI-ITheme-CornerRadius'></a>
|
||||
### CornerRadius `property`
|
||||
|
||||
##### Summary
|
||||
|
||||
Gets the corner radius of the current theme.
|
||||
|
||||
<a name='P-DesktopMagicPluginAPI-ITheme-Font'></a>
|
||||
### Font `property`
|
||||
|
||||
##### Summary
|
||||
|
||||
Gets the font of the current theme.
|
||||
|
||||
<a name='P-DesktopMagicPluginAPI-ITheme-Margin'></a>
|
||||
### Margin `property`
|
||||
|
||||
##### Summary
|
||||
|
||||
Gets the corner radius of the current theme.
|
||||
|
||||
<a name='P-DesktopMagicPluginAPI-ITheme-PrimaryColor'></a>
|
||||
### PrimaryColor `property`
|
||||
|
||||
##### Summary
|
||||
|
||||
Gets the primary color of the current theme.
|
||||
|
||||
<a name='P-DesktopMagicPluginAPI-ITheme-SecondaryColor'></a>
|
||||
### SecondaryColor `property`
|
||||
|
||||
##### Summary
|
||||
|
||||
Gets the secondary color of the current theme.
|
||||
|
||||
<a name='T-DesktopMagicPluginAPI-Inputs-IntegerUpDown'></a>
|
||||
## IntegerUpDown `type`
|
||||
|
||||
##### Namespace
|
||||
|
||||
DesktopMagicPluginAPI.Inputs
|
||||
|
||||
##### Summary
|
||||
|
||||
Represents a up-down control.
|
||||
|
||||
<a name='M-DesktopMagicPluginAPI-Inputs-IntegerUpDown-#ctor-System-Int32,System-Int32,System-Int32-'></a>
|
||||
### #ctor(min,max,value) `constructor`
|
||||
|
||||
##### Summary
|
||||
|
||||
Initializes a new instance of the [IntegerUpDown](#T-DesktopMagicPluginAPI-Inputs-IntegerUpDown 'DesktopMagicPluginAPI.Inputs.IntegerUpDown') class with the provided `min` value, `max` value and `value`.
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| min | [System.Int32](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Int32 'System.Int32') | The maximum value for the [IntegerUpDown](#T-DesktopMagicPluginAPI-Inputs-IntegerUpDown 'DesktopMagicPluginAPI.Inputs.IntegerUpDown') element. |
|
||||
| max | [System.Int32](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Int32 'System.Int32') | The minimum value for the [IntegerUpDown](#T-DesktopMagicPluginAPI-Inputs-IntegerUpDown 'DesktopMagicPluginAPI.Inputs.IntegerUpDown') element. |
|
||||
| value | [System.Int32](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Int32 'System.Int32') | The value assigned to the [IntegerUpDown](#T-DesktopMagicPluginAPI-Inputs-IntegerUpDown 'DesktopMagicPluginAPI.Inputs.IntegerUpDown') element. |
|
||||
|
||||
##### Exceptions
|
||||
|
||||
| Name | Description |
|
||||
| ---- | ----------- |
|
||||
| [System.ArgumentException](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.ArgumentException 'System.ArgumentException') | |
|
||||
|
||||
<a name='P-DesktopMagicPluginAPI-Inputs-IntegerUpDown-Maximum'></a>
|
||||
### Maximum `property`
|
||||
|
||||
##### Summary
|
||||
|
||||
Gets or sets the maximum value for the [IntegerUpDown](#T-DesktopMagicPluginAPI-Inputs-IntegerUpDown 'DesktopMagicPluginAPI.Inputs.IntegerUpDown') element.
|
||||
|
||||
<a name='P-DesktopMagicPluginAPI-Inputs-IntegerUpDown-Minimum'></a>
|
||||
### Minimum `property`
|
||||
|
||||
##### Summary
|
||||
|
||||
Gets or sets the minimum value for the [IntegerUpDown](#T-DesktopMagicPluginAPI-Inputs-IntegerUpDown 'DesktopMagicPluginAPI.Inputs.IntegerUpDown') element.
|
||||
|
||||
<a name='P-DesktopMagicPluginAPI-Inputs-IntegerUpDown-Value'></a>
|
||||
### Value `property`
|
||||
|
||||
##### Summary
|
||||
|
||||
Gets or sets the value assigned to the [IntegerUpDown](#T-DesktopMagicPluginAPI-Inputs-IntegerUpDown 'DesktopMagicPluginAPI.Inputs.IntegerUpDown') element.
|
||||
|
||||
<a name='T-DesktopMagicPluginAPI-Inputs-Label'></a>
|
||||
## Label `type`
|
||||
|
||||
##### Namespace
|
||||
|
||||
DesktopMagicPluginAPI.Inputs
|
||||
|
||||
##### Summary
|
||||
|
||||
Represents a label control.
|
||||
|
||||
<a name='M-DesktopMagicPluginAPI-Inputs-Label-#ctor-System-String,System-Boolean-'></a>
|
||||
### #ctor(value,bold) `constructor`
|
||||
|
||||
##### Summary
|
||||
|
||||
Initializes a new instance of the [Label](#T-DesktopMagicPluginAPI-Inputs-Label 'DesktopMagicPluginAPI.Inputs.Label') class with the provided `value`.
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| value | [System.String](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.String 'System.String') | The text associated with this [Label](#T-DesktopMagicPluginAPI-Inputs-Label 'DesktopMagicPluginAPI.Inputs.Label') |
|
||||
| bold | [System.Boolean](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Boolean 'System.Boolean') | A value indicating whether the content of the [Label](#T-DesktopMagicPluginAPI-Inputs-Label 'DesktopMagicPluginAPI.Inputs.Label') is bold or not. |
|
||||
|
||||
<a name='P-DesktopMagicPluginAPI-Inputs-Label-Bold'></a>
|
||||
### Bold `property`
|
||||
|
||||
##### Summary
|
||||
|
||||
Gets or set a value indicating whether the content of the [Label](#T-DesktopMagicPluginAPI-Inputs-Label 'DesktopMagicPluginAPI.Inputs.Label') is bold or not.
|
||||
|
||||
<a name='P-DesktopMagicPluginAPI-Inputs-Label-Value'></a>
|
||||
### Value `property`
|
||||
|
||||
##### Summary
|
||||
|
||||
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`
|
||||
|
||||
##### Namespace
|
||||
|
||||
DesktopMagicPluginAPI
|
||||
|
||||
##### Summary
|
||||
|
||||
The plugin class.
|
||||
|
||||
<a name='P-DesktopMagicPluginAPI-Plugin-Application'></a>
|
||||
### Application `property`
|
||||
|
||||
##### Summary
|
||||
|
||||
Informations about the main application.
|
||||
|
||||
<a name='P-DesktopMagicPluginAPI-Plugin-RenderQuality'></a>
|
||||
### RenderQuality `property`
|
||||
|
||||
##### Summary
|
||||
|
||||
Gets or sets the render quality of the bitmap image.
|
||||
|
||||
<a name='P-DesktopMagicPluginAPI-Plugin-UpdateInterval'></a>
|
||||
### UpdateInterval `property`
|
||||
|
||||
##### Summary
|
||||
|
||||
Gets or sets the interval, expressed in milliseconds, at which to call the [Main](#M-DesktopMagicPluginAPI-Plugin-Main 'DesktopMagicPluginAPI.Plugin.Main') method.
|
||||
|
||||
<a name='M-DesktopMagicPluginAPI-Plugin-Main'></a>
|
||||
### Main() `method`
|
||||
|
||||
##### Summary
|
||||
|
||||
Occurs when the [UpdateInterval](#P-DesktopMagicPluginAPI-Plugin-UpdateInterval 'DesktopMagicPluginAPI.Plugin.UpdateInterval') elapses.
|
||||
|
||||
##### Returns
|
||||
|
||||
|
||||
|
||||
##### Parameters
|
||||
|
||||
This method has no parameters.
|
||||
|
||||
<a name='M-DesktopMagicPluginAPI-Plugin-OnMouseClick-System-Drawing-Point,DesktopMagicPluginAPI-Inputs-MouseButton-'></a>
|
||||
### OnMouseClick(position,mouseButton) `method`
|
||||
|
||||
##### Summary
|
||||
|
||||
Occurs when the window is clicked by the mouse.
|
||||
|
||||
##### Parameters
|
||||
|
||||
| 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') | 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') | The button associated with the event. |
|
||||
|
||||
<a name='M-DesktopMagicPluginAPI-Plugin-OnMouseMove-System-Drawing-Point-'></a>
|
||||
### OnMouseMove(position) `method`
|
||||
|
||||
##### Summary
|
||||
|
||||
Occurs when the mouse pointer is moved over the control.
|
||||
|
||||
##### Parameters
|
||||
|
||||
| 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') | The x- and y-coordinates of the mouse pointer position relative to the plugin window. |
|
||||
|
||||
<a name='M-DesktopMagicPluginAPI-Plugin-OnMouseWheel-System-Drawing-Point,System-Int32-'></a>
|
||||
### OnMouseWheel(position,delta) `method`
|
||||
|
||||
##### Summary
|
||||
|
||||
Occurs when the user rotates the mouse wheel while the mouse pointer is over this element.
|
||||
|
||||
##### Parameters
|
||||
|
||||
| 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') | The x- and y-coordinates of the mouse pointer position relative to the plugin window. |
|
||||
| delta | [System.Int32](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Int32 'System.Int32') | A value that indicates the amount that the mouse wheel has changed. |
|
||||
|
||||
<a name='M-DesktopMagicPluginAPI-Plugin-Start'></a>
|
||||
### Start() `method`
|
||||
|
||||
##### Summary
|
||||
|
||||
Occurs once when the plugin gets activated.
|
||||
|
||||
##### Parameters
|
||||
|
||||
This method has no parameters.
|
||||
|
||||
<a name='M-DesktopMagicPluginAPI-Plugin-Stop'></a>
|
||||
### Stop() `method`
|
||||
|
||||
##### Summary
|
||||
|
||||
Occurs once when the plugin gets deactivated.
|
||||
|
||||
##### Parameters
|
||||
|
||||
This method has no parameters.
|
||||
|
||||
<a name='T-DesktopMagicPluginAPI-Drawing-RenderQuality'></a>
|
||||
## RenderQuality `type`
|
||||
|
||||
##### Namespace
|
||||
|
||||
DesktopMagicPluginAPI.Drawing
|
||||
|
||||
##### Summary
|
||||
|
||||
Specifies which render quality is used to display the bitmap images.
|
||||
|
||||
<a name='F-DesktopMagicPluginAPI-Drawing-RenderQuality-High'></a>
|
||||
### High `constants`
|
||||
|
||||
##### Summary
|
||||
|
||||
Slower then [Low](#F-DesktopMagicPluginAPI-Drawing-RenderQuality-Low 'DesktopMagicPluginAPI.Drawing.RenderQuality.Low') but produces higher quality output.
|
||||
|
||||
<a name='F-DesktopMagicPluginAPI-Drawing-RenderQuality-Low'></a>
|
||||
### Low `constants`
|
||||
|
||||
##### Summary
|
||||
|
||||
Faster then [High](#F-DesktopMagicPluginAPI-Drawing-RenderQuality-High 'DesktopMagicPluginAPI.Drawing.RenderQuality.High') but produces lower quality output.
|
||||
|
||||
<a name='F-DesktopMagicPluginAPI-Drawing-RenderQuality-Performance'></a>
|
||||
### Performance `constants`
|
||||
|
||||
##### Summary
|
||||
|
||||
Provides performance benefits over [Low](#F-DesktopMagicPluginAPI-Drawing-RenderQuality-Low 'DesktopMagicPluginAPI.Drawing.RenderQuality.Low')
|
||||
|
||||
<a name='T-DesktopMagicPluginAPI-Inputs-Slider'></a>
|
||||
## Slider `type`
|
||||
|
||||
##### Namespace
|
||||
|
||||
DesktopMagicPluginAPI.Inputs
|
||||
|
||||
##### Summary
|
||||
|
||||
Represents a slider control.
|
||||
|
||||
<a name='M-DesktopMagicPluginAPI-Inputs-Slider-#ctor-System-Double,System-Double,System-Double-'></a>
|
||||
### #ctor(min,max,value) `constructor`
|
||||
|
||||
##### Summary
|
||||
|
||||
Initializes a new instance of the [Slider](#T-DesktopMagicPluginAPI-Inputs-Slider 'DesktopMagicPluginAPI.Inputs.Slider') class with the provided `min` value, `max` value and `value`.
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| min | [System.Double](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Double 'System.Double') | The maximum value for the [Slider](#T-DesktopMagicPluginAPI-Inputs-Slider 'DesktopMagicPluginAPI.Inputs.Slider') element. |
|
||||
| max | [System.Double](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Double 'System.Double') | The minimum value for the [Slider](#T-DesktopMagicPluginAPI-Inputs-Slider 'DesktopMagicPluginAPI.Inputs.Slider') element. |
|
||||
| value | [System.Double](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.Double 'System.Double') | The value assigned to the [Slider](#T-DesktopMagicPluginAPI-Inputs-Slider 'DesktopMagicPluginAPI.Inputs.Slider') element. |
|
||||
|
||||
<a name='P-DesktopMagicPluginAPI-Inputs-Slider-Maximum'></a>
|
||||
### Maximum `property`
|
||||
|
||||
##### Summary
|
||||
|
||||
Gets or sets the maximum value for the [Slider](#T-DesktopMagicPluginAPI-Inputs-Slider 'DesktopMagicPluginAPI.Inputs.Slider') element.
|
||||
|
||||
<a name='P-DesktopMagicPluginAPI-Inputs-Slider-Minimum'></a>
|
||||
### Minimum `property`
|
||||
|
||||
##### Summary
|
||||
|
||||
Gets or sets the minimum value for the [Slider](#T-DesktopMagicPluginAPI-Inputs-Slider 'DesktopMagicPluginAPI.Inputs.Slider') element.
|
||||
|
||||
<a name='P-DesktopMagicPluginAPI-Inputs-Slider-Value'></a>
|
||||
### Value `property`
|
||||
|
||||
##### Summary
|
||||
|
||||
Gets or sets the value assigned to the [Slider](#T-DesktopMagicPluginAPI-Inputs-Slider 'DesktopMagicPluginAPI.Inputs.Slider') element.
|
||||
|
||||
<a name='T-DesktopMagicPluginAPI-Inputs-TextBox'></a>
|
||||
## TextBox `type`
|
||||
|
||||
##### Namespace
|
||||
|
||||
DesktopMagicPluginAPI.Inputs
|
||||
|
||||
##### Summary
|
||||
|
||||
Represents a text box control.
|
||||
|
||||
<a name='M-DesktopMagicPluginAPI-Inputs-TextBox-#ctor-System-String-'></a>
|
||||
### #ctor(value) `constructor`
|
||||
|
||||
##### Summary
|
||||
|
||||
Initializes a new instance of the [TextBox](#T-DesktopMagicPluginAPI-Inputs-TextBox 'DesktopMagicPluginAPI.Inputs.TextBox') class with the provided `value`.
|
||||
|
||||
##### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| ---- | ---- | ----------- |
|
||||
| value | [System.String](http://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k:System.String 'System.String') | The text associated with this control. |
|
||||
|
||||
<a name='P-DesktopMagicPluginAPI-Inputs-TextBox-Value'></a>
|
||||
### Value `property`
|
||||
|
||||
##### Summary
|
||||
|
||||
Gets or sets the text associated with this [TextBox](#T-DesktopMagicPluginAPI-Inputs-TextBox 'DesktopMagicPluginAPI.Inputs.TextBox').
|
||||