diff --git a/ShareX.ScreenCaptureLib/Shapes/BaseShape.cs b/ShareX.ScreenCaptureLib/Shapes/BaseShape.cs index af410e3f3..c7e33b483 100644 --- a/ShareX.ScreenCaptureLib/Shapes/BaseShape.cs +++ b/ShareX.ScreenCaptureLib/Shapes/BaseShape.cs @@ -38,13 +38,7 @@ public abstract class BaseShape public Rectangle Rectangle { get; set; } - protected AnnotationOptions AnnotationOptions - { - get - { - return Manager.Config.AnnotationOptions; - } - } + protected AnnotationOptions AnnotationOptions => Manager.Config.AnnotationOptions; private Point startPosition; @@ -78,13 +72,7 @@ public Point EndPosition } } - public virtual bool IsValidShape - { - get - { - return !Rectangle.IsEmpty && Rectangle.Width >= MinimumSize && Rectangle.Height >= MinimumSize; - } - } + public virtual bool IsValidShape => !Rectangle.IsEmpty && Rectangle.Width >= MinimumSize && Rectangle.Height >= MinimumSize; public virtual bool IsRegionShape { get; } = false; diff --git a/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs b/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs index 91e36077a..ea572e912 100644 --- a/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs +++ b/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs @@ -104,55 +104,19 @@ public Rectangle CurrentRectangle } } - public bool IsCurrentShapeValid - { - get - { - return CurrentShape != null && CurrentShape.IsValidShape; - } - } + public bool IsCurrentShapeValid => CurrentShape != null && CurrentShape.IsValidShape; - public BaseShape[] Regions - { - get - { - return Shapes.OfType().ToArray(); - } - } + public BaseShape[] Regions => Shapes.OfType().ToArray(); - public BaseDrawingShape[] DrawingShapes - { - get - { - return Shapes.OfType().ToArray(); - } - } + public BaseShape[] ValidRegions => Regions.Where(x => x.IsValidShape).ToArray(); - public BaseEffectShape[] EffectShapes - { - get - { - return Shapes.OfType().ToArray(); - } - } + public BaseDrawingShape[] DrawingShapes => Shapes.OfType().ToArray(); - public BaseShape[] ValidRegions - { - get - { - return Regions.Where(x => x.IsValidShape).ToArray(); - } - } + public BaseEffectShape[] EffectShapes => Shapes.OfType().ToArray(); public BaseShape CurrentHoverShape { get; private set; } - public bool IsCurrentHoverShapeValid - { - get - { - return CurrentHoverShape != null && CurrentHoverShape.IsValidShape; - } - } + public bool IsCurrentHoverShapeValid => CurrentHoverShape != null && CurrentHoverShape.IsValidShape; public bool IsCurrentShapeTypeRegion { @@ -185,13 +149,7 @@ public bool IsCurrentShapeTypeRegion public RegionCaptureOptions Config { get; private set; } - public AnnotationOptions AnnotationOptions - { - get - { - return Config.AnnotationOptions; - } - } + public AnnotationOptions AnnotationOptions => Config.AnnotationOptions; public NodeObject[] Nodes { get; private set; } @@ -227,13 +185,7 @@ public bool NodesVisible } } - public bool IsCursorOnNode - { - get - { - return NodesVisible && Nodes.Any(node => node.IsCursorHover); - } - } + public bool IsCursorOnNode => NodesVisible && Nodes.Any(node => node.IsCursorHover); public event Action CurrentShapeChanged; public event Action CurrentShapeTypeChanged;