UI - Added Avalonia projects

This commit is contained in:
Robert committed 2021-10-09 23:51:42 +02:00
1 parent c45f1d9130
commit 1784d2b8b5
80 files changed
+4901 -31

No files matched your search

@@ -16,7 +16,7 @@ namespace Artemis.Core
/// <returns>The RGB.NET color</returns>
public static Color ToRgbColor(this SKColor color)
{
return new(color.Alpha, color.Red, color.Green, color.Blue);
return new Color(color.Alpha, color.Red, color.Green, color.Blue);
}
/// <summary>
@@ -49,7 +49,7 @@ namespace Artemis.Core
/// <returns>The sum of the two colors</returns>
public static SKColor Sum(this SKColor a, SKColor b)
{
return new(
return new SKColor(
ClampToByte(a.Red + b.Red),
ClampToByte(a.Green + b.Green),
ClampToByte(a.Blue + b.Blue),
@@ -15,7 +15,7 @@ namespace Artemis.Core
protected DataModelConditionPart()
{
Children = new(_children);
Children = new ReadOnlyCollection<DataModelConditionPart>(_children);
}
/// <summary>
@@ -18,7 +18,7 @@ namespace Artemis.Core
{
DataBinding = dataBinding;
Entity = entity;
Conditions = new(_conditions);
Conditions = new ReadOnlyCollection<DataBindingCondition<TLayerProperty, TProperty>>(_conditions);
Load();
}
@@ -17,7 +17,7 @@ namespace Artemis.Core
{
DataBinding = dataBinding;
Entity = entity;
Modifiers = new(_modifiers);
Modifiers = new ReadOnlyCollection<DataBindingModifier<TLayerProperty, TProperty>>(_modifiers);
Load();
}
@@ -44,7 +44,7 @@ namespace Artemis.Core
_baseValue = default!;
_keyframes = new List<LayerPropertyKeyframe<T>>();
Keyframes = new(_keyframes);
Keyframes = new ReadOnlyCollection<LayerPropertyKeyframe<T>>(_keyframes);
}
/// <summary>
@@ -66,7 +66,7 @@ namespace Artemis.Core
/// <inheritdoc />
public KeyframeEntity GetKeyframeEntity()
{
return new()
return new KeyframeEntity
{
Value = CoreJson.SerializeObject(Value),
Position = Position,
@@ -38,8 +38,8 @@ namespace Artemis.Core
_layerProperties = new List<ILayerProperty>();
_layerPropertyGroups = new List<LayerPropertyGroup>();
LayerProperties = new(_layerProperties);
LayerPropertyGroups = new(_layerPropertyGroups);
LayerProperties = new ReadOnlyCollection<ILayerProperty>(_layerProperties);
LayerPropertyGroups = new ReadOnlyCollection<LayerPropertyGroup>(_layerPropertyGroups);
}
/// <summary>
@@ -24,14 +24,14 @@ namespace Artemis.Core
{
_name = name;
Entity = new ProfileCategoryEntity();
ProfileConfigurations = new(_profileConfigurations);
ProfileConfigurations = new ReadOnlyCollection<ProfileConfiguration>(_profileConfigurations);
}
internal ProfileCategory(ProfileCategoryEntity entity)
{
_name = null!;
Entity = entity;
ProfileConfigurations = new(_profileConfigurations);
ProfileConfigurations = new ReadOnlyCollection<ProfileConfiguration>(_profileConfigurations);
Load();
}
@@ -24,7 +24,7 @@ namespace Artemis.Core
{
_profile = profile;
ChildrenList = new List<ProfileElement>();
Children = new(ChildrenList);
Children = new ReadOnlyCollection<ProfileElement>(ChildrenList);
}
/// <summary>
@@ -24,7 +24,7 @@ namespace Artemis.Core
Timeline = new Timeline();
ExpandedPropertyGroups = new List<string>();
LayerEffectsList = new List<BaseLayerEffect>();
LayerEffects = new(LayerEffectsList);
LayerEffects = new ReadOnlyCollection<BaseLayerEffect>(LayerEffectsList);
LayerEffectStore.LayerEffectAdded += LayerEffectStoreOnLayerEffectAdded;
LayerEffectStore.LayerEffectRemoved += LayerEffectStoreOnLayerEffectRemoved;
+3 -3
View File
@@ -24,7 +24,7 @@ namespace Artemis.Core
MainSegmentLength = TimeSpan.FromSeconds(5);
_extraTimelines = new List<Timeline>();
ExtraTimelines = new(_extraTimelines);
ExtraTimelines = new ReadOnlyCollection<Timeline>(_extraTimelines);
Save();
}
@@ -33,7 +33,7 @@ namespace Artemis.Core
{
Entity = entity;
_extraTimelines = new List<Timeline>();
ExtraTimelines = new(_extraTimelines);
ExtraTimelines = new ReadOnlyCollection<Timeline>(_extraTimelines);
Load();
}
@@ -47,7 +47,7 @@ namespace Artemis.Core
EndSegmentLength = Parent.EndSegmentLength;
_extraTimelines = new List<Timeline>();
ExtraTimelines = new(_extraTimelines);
ExtraTimelines = new ReadOnlyCollection<Timeline>(_extraTimelines);
}
/// <inheritdoc />
@@ -17,7 +17,7 @@ namespace Artemis.Core.LayerBrushes
protected LayerBrushProvider()
{
_layerBrushDescriptors = new List<LayerBrushDescriptor>();
LayerBrushDescriptors = new(_layerBrushDescriptors);
LayerBrushDescriptors = new ReadOnlyCollection<LayerBrushDescriptor>(_layerBrushDescriptors);
Disabled += OnDisabled;
}
@@ -18,7 +18,7 @@ namespace Artemis.Core.LayerEffects
protected LayerEffectProvider()
{
_layerEffectDescriptors = new List<LayerEffectDescriptor>();
LayerEffectDescriptors = new(_layerEffectDescriptors);
LayerEffectDescriptors = new ReadOnlyCollection<LayerEffectDescriptor>(_layerEffectDescriptors);
Disabled += OnDisabled;
}
@@ -27,8 +27,8 @@ namespace Artemis.Core.Modules
Module = null!;
DataModelDescription = null!;
ActivePaths = new(_activePaths);
DynamicChildren = new(_dynamicChildren);
ActivePaths = new ReadOnlyCollection<DataModelPath>(_activePaths);
DynamicChildren = new ReadOnlyDictionary<string, DynamicChild>(_dynamicChildren);
}
/// <summary>
+2 -2
View File
@@ -117,7 +117,7 @@ namespace Artemis.Core.Modules
protected Module()
{
DefaultProfilePaths = new ReadOnlyCollection<(DefaultCategoryName, string)>(_defaultProfilePaths);
HiddenProperties = new(HiddenPropertiesList);
HiddenProperties = new ReadOnlyCollection<PropertyInfo>(HiddenPropertiesList);
}
/// <summary>
@@ -237,7 +237,7 @@ namespace Artemis.Core.Modules
/// <returns></returns>
public virtual DataModelPropertyAttribute GetDataModelDescription()
{
return new() {Name = Info.Name, Description = Info.Description};
return new DataModelPropertyAttribute {Name = Info.Name, Description = Info.Description};
}
/// <summary>
+2 -2
View File
@@ -31,8 +31,8 @@ namespace Artemis.Core
_features = new List<PluginFeatureInfo>();
_profilers = new List<Profiler>();
Features = new(_features);
Profilers = new(_profilers);
Features = new ReadOnlyCollection<PluginFeatureInfo>(_features);
Profilers = new ReadOnlyCollection<Profiler>(_profilers);
}
/// <summary>
@@ -70,7 +70,7 @@ namespace Artemis.Core
/// </summary>
public TimeSpan GetLast()
{
return new(_last);
return new TimeSpan(_last);
}
/// <summary>
@@ -46,7 +46,7 @@ namespace Artemis.Core.ScriptingProviders
{
protected ScriptingProvider()
{
Scripts = new(InternalScripts);
Scripts = new ReadOnlyCollection<Script>(InternalScripts);
}
/// <summary>
@@ -66,7 +66,7 @@ namespace Artemis.Core.Services
float bestDarkMutedScore = 0;
//ugly but at least we only loop through the enumerable once ¯\_(ツ)_/¯
foreach (var color in colors)
foreach (SKColor color in colors)
{
static void SetIfBetterScore(ref float bestScore, ref SKColor bestColor, SKColor newColor, ColorType type, bool ignoreLimits)
{
@@ -86,7 +86,7 @@ namespace Artemis.Core.Services
SetIfBetterScore(ref bestDarkMutedScore, ref bestDarkMutedColor, color, ColorType.DarkMuted, ignoreLimits);
}
return new()
return new ColorSwatch
{
Vibrant = bestVibrantColor,
LightVibrant = bestLightVibrantColor,
@@ -435,7 +435,7 @@ namespace Artemis.Core.Services
}
catch (Exception e)
{
_logger.Warning(new ArtemisPluginException(plugin, "Failed to instantiate feature", e), "Failed to instantiate feature", plugin);
_logger.Warning(new ArtemisPluginException(plugin, "Failed to instantiate feature", e), "Failed to instantiate feature from plugin {plugin}", plugin);
featureInfo.LoadException = e;
}
}
@@ -24,7 +24,7 @@ namespace Artemis.Core.Services
_profileService = profileService;
InternalGlobalScripts = new List<GlobalScript>();
GlobalScripts = new(InternalGlobalScripts);
GlobalScripts = new ReadOnlyCollection<GlobalScript>(InternalGlobalScripts);
_pluginManagementService.PluginFeatureEnabled += PluginManagementServiceOnPluginFeatureToggled;
_pluginManagementService.PluginFeatureDisabled += PluginManagementServiceOnPluginFeatureToggled;