Code style - Omit the type in a new expressions

This commit is contained in:
SpoinkyNL committed 2020-12-18 17:54:01 +01:00
1 parent 099f56f4fe
commit 10e6cdc54b
117 files changed
+251 -252

No files matched your search

@@ -62,7 +62,7 @@ namespace Artemis.UI.Screens.ProfileEditor.Visualization.Tools
ShapeAnchor = _layerEditorService.GetLayerAnchorPosition(layer).ToSKPoint();
Execute.PostToUIThread(() =>
{
RectangleGeometry shapeGeometry = new RectangleGeometry(_layerEditorService.GetLayerBounds(layer))
RectangleGeometry shapeGeometry = new(_layerEditorService.GetLayerBounds(layer))
{
Transform = _layerEditorService.GetLayerTransformGroup(layer)
};
@@ -392,12 +392,12 @@ namespace Artemis.UI.Screens.ProfileEditor.Visualization.Tools
private static SKPoint RoundPoint(SKPoint point, int decimals)
{
return new SKPoint((float) Math.Round(point.X, decimals, MidpointRounding.AwayFromZero), (float) Math.Round(point.Y, decimals, MidpointRounding.AwayFromZero));
return new((float) Math.Round(point.X, decimals, MidpointRounding.AwayFromZero), (float) Math.Round(point.Y, decimals, MidpointRounding.AwayFromZero));
}
private static SKPoint[] UnTransformPoints(SKPoint[] skPoints, Layer layer, SKPoint pivot, bool includeScale)
{
using SKPath counterRotatePath = new SKPath();
using SKPath counterRotatePath = new();
counterRotatePath.AddPoly(skPoints, false);
counterRotatePath.Transform(SKMatrix.CreateRotationDegrees(layer.Transform.Rotation.CurrentValue * -1, pivot.X, pivot.Y));
if (includeScale)
@@ -15,7 +15,7 @@ namespace Artemis.UI.Screens.ProfileEditor.Visualization.Tools
public SelectionRemoveToolViewModel(ProfileViewModel profileViewModel, IProfileEditorService profileEditorService) : base(profileViewModel, profileEditorService)
{
using (MemoryStream stream = new MemoryStream(Resources.aero_pen_min))
using (MemoryStream stream = new(Resources.aero_pen_min))
{
Cursor = new Cursor(stream);
}
@@ -32,7 +32,7 @@ namespace Artemis.UI.Screens.ProfileEditor.Visualization.Tools
base.MouseUp(sender, e);
Point position = ProfileViewModel.PanZoomViewModel.GetRelativeMousePosition(sender, e);
Rect selectedRect = new Rect(MouseDownStartPosition, position);
Rect selectedRect = new(MouseDownStartPosition, position);
// Get selected LEDs
List<ArtemisLed> selectedLeds = ProfileViewModel.GetLedsInRectangle(selectedRect);
@@ -60,7 +60,7 @@ namespace Artemis.UI.Screens.ProfileEditor.Visualization.Tools
}
Point position = ProfileViewModel.PanZoomViewModel.GetRelativeMousePosition(sender, e);
Rect selectedRect = new Rect(MouseDownStartPosition, position);
Rect selectedRect = new(MouseDownStartPosition, position);
List<ArtemisLed> selectedLeds = ProfileViewModel.GetLedsInRectangle(selectedRect);
// Unless shift is held down, clear the current selection
@@ -21,7 +21,7 @@ namespace Artemis.UI.Screens.ProfileEditor.Visualization.Tools
ILayerBrushService layerBrushService) : base(profileViewModel, profileEditorService)
{
_layerBrushService = layerBrushService;
using (MemoryStream stream = new MemoryStream(Resources.aero_crosshair))
using (MemoryStream stream = new(Resources.aero_crosshair))
{
Cursor = new Cursor(stream);
}
@@ -38,7 +38,7 @@ namespace Artemis.UI.Screens.ProfileEditor.Visualization.Tools
base.MouseUp(sender, e);
Point position = ProfileViewModel.PanZoomViewModel.GetRelativeMousePosition(sender, e);
Rect selectedRect = new Rect(MouseDownStartPosition, position);
Rect selectedRect = new(MouseDownStartPosition, position);
// Get selected LEDs
List<ArtemisLed> selectedLeds = ProfileViewModel.GetLedsInRectangle(selectedRect);
@@ -78,7 +78,7 @@ namespace Artemis.UI.Screens.ProfileEditor.Visualization.Tools
}
Point position = ProfileViewModel.PanZoomViewModel.GetRelativeMousePosition(sender, e);
Rect selectedRect = new Rect(MouseDownStartPosition, position);
Rect selectedRect = new(MouseDownStartPosition, position);
List<ArtemisLed> selectedLeds = ProfileViewModel.GetLedsInRectangle(selectedRect);
// Unless shift is held down, clear the current selection
@@ -91,7 +91,7 @@ namespace Artemis.UI.Screens.ProfileEditor.Visualization.Tools
private void CreateLayer(Folder folder, List<ArtemisLed> selectedLeds)
{
Layer newLayer = new Layer(folder, "New layer");
Layer newLayer = new(folder, "New layer");
LayerBrushDescriptor brush = _layerBrushService.GetDefaultLayerBrush();
if (brush != null)