mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Profile editor - Moved layer property input to the Shared UI project
This commit is contained in:
1 parent
a5b66441d9
commit
f1cbfb36e9
71 files changed
+1211
-434
No files matched your search
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using Artemis.Core.Extensions;
|
||||
using Artemis.Core.Plugins.Models;
|
||||
@@ -44,12 +43,7 @@ namespace Artemis.Core.Plugins.Abstract
|
||||
}
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
// Does not happen with device providers, they require Artemis to restart
|
||||
}
|
||||
|
||||
public override void DisablePlugin()
|
||||
protected override void DisablePlugin()
|
||||
{
|
||||
// Does not happen with device providers, they require Artemis to restart
|
||||
}
|
||||
|
||||
@@ -17,30 +17,35 @@ namespace Artemis.Core.Plugins.Abstract
|
||||
|
||||
public PluginInfo PluginInfo { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets whether the plugin is enabled
|
||||
/// </summary>
|
||||
public bool Enabled { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets whether this plugin has a configuration view model.
|
||||
/// If set to true, <see cref="GetConfigurationViewModel" /> will be called when the plugin is configured from the UI.
|
||||
/// </summary>
|
||||
public bool HasConfigurationViewModel { get; protected set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Called when the plugin is unloaded, clean up any unmanaged resources here
|
||||
/// </summary>
|
||||
public abstract void Dispose();
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when the plugin is activated
|
||||
/// </summary>
|
||||
public abstract void EnablePlugin();
|
||||
protected abstract void EnablePlugin();
|
||||
|
||||
/// <summary>
|
||||
/// Called when the plugin is deactivated
|
||||
/// </summary>
|
||||
public abstract void DisablePlugin();
|
||||
protected abstract void DisablePlugin();
|
||||
|
||||
/// <summary>
|
||||
/// Called when the plugin's configuration window is opened from the UI. The UI will only attempt to open if
|
||||
/// Called when the plugins configuration window is opened from the UI. The UI will only attempt to open if
|
||||
/// <see cref="HasConfigurationViewModel" /> is set to True.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
@@ -48,5 +53,49 @@ namespace Artemis.Core.Plugins.Abstract
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when Artemis shuts down
|
||||
/// </summary>
|
||||
/// <param name="disposing"></param>
|
||||
protected virtual void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
internal void SetEnabled(bool enable)
|
||||
{
|
||||
if (enable && !Enabled)
|
||||
{
|
||||
EnablePlugin();
|
||||
OnPluginEnabled();
|
||||
}
|
||||
else if (!enable && Enabled)
|
||||
{
|
||||
DisablePlugin();
|
||||
OnPluginDisabled();
|
||||
}
|
||||
|
||||
Enabled = enable;
|
||||
}
|
||||
|
||||
#region Events
|
||||
|
||||
public event EventHandler PluginEnabled;
|
||||
public event EventHandler PluginDisabled;
|
||||
|
||||
protected virtual void OnPluginEnabled()
|
||||
{
|
||||
PluginEnabled?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
protected virtual void OnPluginDisabled()
|
||||
{
|
||||
PluginDisabled?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -15,11 +15,6 @@ namespace Artemis.Core.Plugins.Abstract
|
||||
|
||||
public Profile ActiveProfile { get; private set; }
|
||||
|
||||
public override void EnablePlugin()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Update(double deltaTime)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user