Core - Remove API versioning, we have MinimumVersion to achieve the same thing

This commit is contained in:
Robert committed 2025-12-19 23:11:27 +01:00
1 parent e2cb73e327
commit 86f2426f37
184 files changed
+598 -523

No files matched your search

@@ -24,14 +24,14 @@ public class DisplayConditionScriptViewModel : ActivatableViewModelBase
_profileEditorService = profileEditorService;
_conditionVmFactory = conditionVmFactory;
ConditionTypeViewModels = new ObservableCollection<ConditionTypeViewModel>
{
new("Always", "The element is always active.", typeof(AlwaysOnCondition)),
new("Once", "The element is shown once until its timeline is finished.", typeof(PlayOnceCondition)),
new("Conditional", "The element is activated when the provided visual script ends in true.", typeof(StaticCondition)),
new("On event", "The element is activated when the selected event fires.\r\n" +
"Events that contain data can conditionally trigger the layer using a visual script.", typeof(EventCondition))
};
ConditionTypeViewModels =
[
new ConditionTypeViewModel("Always", "The element is always active.", typeof(AlwaysOnCondition)),
new ConditionTypeViewModel("Once", "The element is shown once until its timeline is finished.", typeof(PlayOnceCondition)),
new ConditionTypeViewModel("Conditional", "The element is activated when the provided visual script ends in true.", typeof(StaticCondition)),
new ConditionTypeViewModel("On event", "The element is activated when the selected event fires.\r\n" +
"Events that contain data can conditionally trigger the layer using a visual script.", typeof(EventCondition))
];
this.WhenActivated(d =>
{
@@ -126,7 +126,7 @@ public class ProfileTreeViewDropHandler : DropHandlerBase
private List<TreeViewItem> GetFlattenedTreeView(ItemsControl currentNode)
{
List<TreeViewItem> result = new();
List<TreeViewItem> result = [];
foreach (Control containerControl in currentNode.GetRealizedContainers())
{
@@ -11,7 +11,7 @@ namespace Artemis.UI.Screens.ProfileEditor.ProfileTree.Dialogs.AdaptionHints;
public partial class SingleLedAdaptionHintViewModel : AdaptionHintViewModelBase
{
[Notify] private List<AdaptionLed> _adaptionLeds = new();
[Notify] private List<AdaptionLed> _adaptionLeds = [];
[Notify] private AdaptionLed? _selectedLed;
public SingleLedAdaptionHintViewModel(Layer layer, SingleLedAdaptionHint adaptionHint) : base(layer, adaptionHint)
@@ -24,7 +24,7 @@ public class LayerHintsDialogViewModel : DialogViewModelBase<bool>
_vmFactory = vmFactory;
Layer = layer;
AdaptionHints = new ObservableCollection<AdaptionHintViewModelBase>();
AdaptionHints = [];
this.WhenActivated(d =>
{
@@ -116,7 +116,7 @@ public partial class ProfileTreeViewModel : TreeItemViewModel
private List<TreeItemViewModel> GetAllTreeItems(ObservableCollection<TreeItemViewModel> treeItems)
{
List<TreeItemViewModel> result = new();
List<TreeItemViewModel> result = [];
foreach (TreeItemViewModel treeItemViewModel in treeItems)
{
result.Add(treeItemViewModel);
@@ -87,7 +87,7 @@ public abstract partial class TreeItemViewModel : ActivatableViewModelBase
public bool IsFocused => _isFocused?.Value ?? false;
public TreeItemViewModel? Parent { get; set; }
public ObservableCollection<TreeItemViewModel> Children { get; } = new();
public ObservableCollection<TreeItemViewModel> Children { get; } = [];
public ReactiveCommand<Unit, Unit> AddLayer { get; }
public ReactiveCommand<Unit, Unit> AddFolder { get; }
@@ -57,7 +57,7 @@ public partial class PropertiesViewModel : ActivatableViewModelBase
_layerEffectService = layerEffectService;
_cachedPropertyViewModels = new Dictionary<LayerPropertyGroup, PropertyGroupViewModel>();
PropertyGroupViewModels = new ObservableCollection<PropertyGroupViewModel>();
PropertyGroupViewModels = [];
PlaybackViewModel = playbackViewModel;
TimelineViewModel = layerPropertyVmFactory.TimelineViewModel(PropertyGroupViewModels);
AddEffect = ReactiveCommand.CreateFromTask(ExecuteAddEffect);
@@ -135,7 +135,7 @@ public partial class PropertiesViewModel : ActivatableViewModelBase
return;
}
ObservableCollection<PropertyGroupViewModel> viewModels = new();
ObservableCollection<PropertyGroupViewModel> viewModels = [];
if (profileElement is Layer layer)
{
// Add base VMs
@@ -83,7 +83,7 @@ public partial class PropertyGroupViewModel : PropertyViewModelBase, IDisposable
public List<ILayerPropertyKeyframe> GetAllKeyframes(bool expandedOnly)
{
List<ILayerPropertyKeyframe> result = new();
List<ILayerPropertyKeyframe> result = [];
if (expandedOnly && !IsExpanded)
return result;
@@ -100,7 +100,7 @@ public partial class PropertyGroupViewModel : PropertyViewModelBase, IDisposable
public List<ITimelineKeyframeViewModel> GetAllKeyframeViewModels(bool expandedOnly)
{
List<ITimelineKeyframeViewModel> result = new();
List<ITimelineKeyframeViewModel> result = [];
if (expandedOnly && !IsExpanded)
return result;
@@ -117,7 +117,7 @@ public partial class PropertyGroupViewModel : PropertyViewModelBase, IDisposable
private void PopulateChildren()
{
Children = new ObservableCollection<PropertyViewModelBase>();
Children = [];
// Get all properties and property groups and create VMs for them
// The group has methods for getting this without reflection but then we lose the order of the properties as they are defined on the group
@@ -20,7 +20,7 @@ public class TimelineEasingViewModel : ViewModelBase
SelectEasingFunction = selectEasingFunction;
Description = easingFunction.Humanize();
EasingPoints = new List<Point>();
EasingPoints = [];
for (int i = 1; i <= 10; i++)
{
int x = i;
@@ -35,7 +35,7 @@ public partial class TimelineKeyframeViewModel<T> : ActivatableViewModelBase, IT
_profileEditorService = profileEditorService;
_timestamp = "0.000";
LayerPropertyKeyframe = layerPropertyKeyframe;
EasingViewModels = new ObservableCollection<TimelineEasingViewModel>();
EasingViewModels = [];
this.WhenActivated(d =>
{
@@ -128,7 +128,7 @@ public partial class TimelineKeyframeViewModel<T> : ActivatableViewModelBase, IT
private async Task ExecuteCopy()
{
List<KeyframeClipboardModel> keyframes = new();
List<KeyframeClipboardModel> keyframes = [];
if (!IsSelected)
keyframes.Add(new KeyframeClipboardModel(Keyframe));
else
@@ -18,7 +18,7 @@ public partial class TimelineGroupViewModel : ActivatableViewModelBase
public TimelineGroupViewModel(PropertyGroupViewModel propertyGroupViewModel, IProfileEditorService profileEditorService)
{
PropertyGroupViewModel = propertyGroupViewModel;
_keyframePositions = new ReadOnlyObservableCollection<double>(new ObservableCollection<double>());
_keyframePositions = new ReadOnlyObservableCollection<double>([]);
this.WhenActivated(d =>
{
@@ -68,7 +68,7 @@ public class TimelinePropertyViewModel<T> : ActivatableViewModelBase, ITimelineP
public List<ILayerPropertyKeyframe> GetAllKeyframes()
{
return LayerProperty.KeyframesEnabled ? new List<ILayerPropertyKeyframe>(LayerProperty.Keyframes) : new List<ILayerPropertyKeyframe>();
return LayerProperty.KeyframesEnabled ? [..LayerProperty.Keyframes] : [];
}
public List<ITimelineKeyframeViewModel> GetAllKeyframeViewModels()
@@ -95,7 +95,7 @@ public class TreeGroupViewModel : ActivatableViewModelBase
}
catch (Exception e)
{
_windowService.ShowExceptionDialog("An exception occurred while trying to show the brush's settings window", e);
_windowService.ShowExceptionDialog("An error occurred while trying to show the brush's settings window", e);
}
}
@@ -120,7 +120,7 @@ public class TreeGroupViewModel : ActivatableViewModelBase
}
catch (Exception e)
{
_windowService.ShowExceptionDialog("An exception occurred while trying to show the effect's settings window", e);
_windowService.ShowExceptionDialog("An error occurred while trying to show the effect's settings window", e);
}
}
@@ -22,7 +22,7 @@ namespace Artemis.UI.Screens.ProfileEditor.VisualEditor.Tools;
public partial class TransformToolView : ReactiveUserControl<TransformToolViewModel>
{
private readonly List<Control> _handles = new();
private readonly List<Control> _handles = [];
private SKPoint _dragOffset;
private ZoomBorder? _zoomBorder;
@@ -225,7 +225,7 @@ public partial class TransformToolViewModel : ToolViewModel
// Add the current position to the start anchor to determine the new position
SKPoint current = start + (position - _dragOffset);
// In order to keep the mouse movement unrotated, counter-act the active rotation
SKPoint[] countered = UnTransformPoints(new[] {start, current}, Layer, start, true);
SKPoint[] countered = UnTransformPoints([start, current], Layer, start, true);
// If shift is held down, round down to 1 decimal to allow moving the anchor in big increments
int decimals = round ? 1 : 3;