mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 11:26:27 +00:00
Core - Added XML comments to all remaining public members/methods
Core - Refactored a lot of code for nullable reference types
This commit is contained in:
1 parent
61fc96742d
commit
a3cd32f6c4
107 files changed
+1150
-649
No files matched your search
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
@@ -9,6 +8,9 @@ using Humanizer;
|
||||
|
||||
namespace Artemis.Core.DataModelExpansions
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a data model that contains information on a game/application etc.
|
||||
/// </summary>
|
||||
public abstract class DataModel
|
||||
{
|
||||
private readonly Dictionary<string, DataModel> _dynamicDataModels = new Dictionary<string, DataModel>();
|
||||
@@ -154,11 +156,17 @@ namespace Artemis.Core.DataModelExpansions
|
||||
/// </summary>
|
||||
public event EventHandler<DynamicDataModelEventArgs>? DynamicDataModelRemoved;
|
||||
|
||||
/// <summary>
|
||||
/// Invokes the <see cref="DynamicDataModelAdded" /> event
|
||||
/// </summary>
|
||||
protected virtual void OnDynamicDataModelAdded(DynamicDataModelEventArgs e)
|
||||
{
|
||||
DynamicDataModelAdded?.Invoke(this, e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invokes the <see cref="DynamicDataModelRemoved" /> event
|
||||
/// </summary>
|
||||
protected virtual void OnDynamicDataModelRemoved(DynamicDataModelEventArgs e)
|
||||
{
|
||||
DynamicDataModelRemoved?.Invoke(this, e);
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
namespace Artemis.Core
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a configuration dialog for a <see cref="Plugin" />
|
||||
/// </summary>
|
||||
public interface IPluginConfigurationDialog
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -9,8 +9,8 @@ namespace Artemis.Core.LayerBrushes
|
||||
public abstract class BaseLayerBrush : CorePropertyChanged, IDisposable
|
||||
{
|
||||
private LayerBrushType _brushType;
|
||||
private ILayerBrushConfigurationDialog _configurationDialog;
|
||||
private LayerBrushDescriptor _descriptor;
|
||||
private ILayerBrushConfigurationDialog? _configurationDialog;
|
||||
private LayerBrushDescriptor? _descriptor;
|
||||
private Layer _layer;
|
||||
private bool _supportsTransformation = true;
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace Artemis.Core.LayerBrushes
|
||||
/// <summary>
|
||||
/// Gets the descriptor of this brush
|
||||
/// </summary>
|
||||
public LayerBrushDescriptor Descriptor
|
||||
public LayerBrushDescriptor? Descriptor
|
||||
{
|
||||
get => _descriptor;
|
||||
internal set => SetAndNotify(ref _descriptor, value);
|
||||
@@ -35,7 +35,7 @@ namespace Artemis.Core.LayerBrushes
|
||||
/// <summary>
|
||||
/// Gets or sets a configuration dialog complementing the regular properties
|
||||
/// </summary>
|
||||
public ILayerBrushConfigurationDialog ConfigurationDialog
|
||||
public ILayerBrushConfigurationDialog? ConfigurationDialog
|
||||
{
|
||||
get => _configurationDialog;
|
||||
protected set => SetAndNotify(ref _configurationDialog, value);
|
||||
@@ -53,12 +53,12 @@ namespace Artemis.Core.LayerBrushes
|
||||
/// <summary>
|
||||
/// Gets the ID of the <see cref="LayerBrushProvider" /> that provided this effect
|
||||
/// </summary>
|
||||
public string ProviderId => Descriptor?.Provider?.Id;
|
||||
public string? ProviderId => Descriptor?.Provider.Id;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a reference to the layer property group without knowing it's type
|
||||
/// </summary>
|
||||
public virtual LayerPropertyGroup BaseProperties => null;
|
||||
public virtual LayerPropertyGroup? BaseProperties => null;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets whether the brush supports transformations
|
||||
@@ -70,7 +70,7 @@ namespace Artemis.Core.LayerBrushes
|
||||
protected set
|
||||
{
|
||||
if (value && BrushType == LayerBrushType.RgbNet)
|
||||
throw new ArtemisPluginFeatureException(Descriptor.Provider, "An RGB.NET brush cannot support transformation");
|
||||
throw new ArtemisPluginFeatureException(Descriptor?.Provider!, "An RGB.NET brush cannot support transformation");
|
||||
_supportsTransformation = value;
|
||||
}
|
||||
}
|
||||
@@ -105,7 +105,7 @@ namespace Artemis.Core.LayerBrushes
|
||||
public void Dispose()
|
||||
{
|
||||
DisableLayerBrush();
|
||||
BaseProperties.Dispose();
|
||||
BaseProperties?.Dispose();
|
||||
|
||||
Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace Artemis.Core.LayerBrushes
|
||||
/// <summary>
|
||||
/// Determines whether the provided <paramref name="reference" /> references to a brush provided by this descriptor
|
||||
/// </summary>
|
||||
public bool MatchesLayerBrushReference(LayerBrushReference reference)
|
||||
public bool MatchesLayerBrushReference(LayerBrushReference? reference)
|
||||
{
|
||||
if (reference == null)
|
||||
return false;
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Artemis.Core.LayerEffects
|
||||
{
|
||||
public interface IEffectConfigurationViewModel
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,8 @@
|
||||
namespace Artemis.Core.LayerEffects
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a configuration dialog for a <see cref="LayerEffect{T}" />
|
||||
/// </summary>
|
||||
public interface ILayerEffectConfigurationDialog
|
||||
{
|
||||
}
|
||||
|
||||
@@ -160,6 +160,7 @@ namespace Artemis.Core
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Dispose()
|
||||
{
|
||||
foreach (PluginFeature feature in Features)
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace Artemis.Core
|
||||
}
|
||||
}
|
||||
|
||||
private void TimerOnElapsed(object sender, ElapsedEventArgs e)
|
||||
private void TimerOnElapsed(object? sender, ElapsedEventArgs e)
|
||||
{
|
||||
if (!Feature.IsEnabled)
|
||||
return;
|
||||
@@ -128,12 +128,12 @@ namespace Artemis.Core
|
||||
}
|
||||
}
|
||||
|
||||
private void FeatureOnEnabled(object sender, EventArgs e)
|
||||
private void FeatureOnEnabled(object? sender, EventArgs e)
|
||||
{
|
||||
Start();
|
||||
}
|
||||
|
||||
private void FeatureOnDisabled(object sender, EventArgs e)
|
||||
private void FeatureOnDisabled(object? sender, EventArgs e)
|
||||
{
|
||||
Stop();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user