Skip to content

Commit e40a36b

Browse files
committed
Tidy up, modernise code and VS cleanup
1 parent 79a2a54 commit e40a36b

220 files changed

Lines changed: 1490 additions & 1998 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ All notable changes to this project will be documented in this file.
1414
- Change default `MinimumSegmentLength` to `2` and remove limits for series and annotations with simple geometry (#1853)
1515
- Improve performance of `StairStepSeries`, particularly when zoomed in and X is monotonic or when consecutive points have equal Y components
1616
- `StairStepSeries` renders a horizontal line when a point with a valid X component and invalid Y component follows a valid point
17+
- Tidy up and modernise code #1920
1718

1819
### Removed
1920

Source/OxyPlot/Annotations/Annotation.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace OxyPlot.Annotations
1717
public abstract class Annotation : PlotElement, IXyAxisPlotElement
1818
{
1919
/// <summary>
20-
/// Initializes a new instance of the <see cref="Annotation" /> class.
20+
/// Initializes a new instance of the <see cref="Annotation"/> class.
2121
/// </summary>
2222
protected Annotation()
2323
{
@@ -27,7 +27,7 @@ protected Annotation()
2727
}
2828

2929
/// <summary>
30-
/// Gets or sets the rendering layer of the annotation. The default value is <see cref="AnnotationLayer.AboveSeries" />.
30+
/// Gets or sets the rendering layer of the annotation. The default value is <see cref="AnnotationLayer.AboveSeries"/>.
3131
/// </summary>
3232
public AnnotationLayer Layer { get; set; }
3333

@@ -48,7 +48,7 @@ protected Annotation()
4848
/// </summary>
4949
/// <value>The Y axis.</value>
5050
public Axis YAxis { get; private set; }
51-
51+
5252
/// <summary>
5353
/// Gets or sets a value indicating whether to clip the annotation by the X axis range.
5454
/// </summary>

Source/OxyPlot/Annotations/AnnotationLayer.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
// Copyright (c) 2014 OxyPlot contributors
44
// </copyright>
55
// <summary>
6-
// Specifies the layer for an <see cref="Annotation" />.
6+
// Specifies the layer for an <see cref="Annotation"/>.
77
// </summary>
88
// --------------------------------------------------------------------------------------------------------------------
99

1010
namespace OxyPlot.Annotations
1111
{
1212
/// <summary>
13-
/// Specifies the layer for an <see cref="Annotation" />.
13+
/// Specifies the layer for an <see cref="Annotation"/>.
1414
/// </summary>
1515
public enum AnnotationLayer
1616
{
@@ -29,4 +29,4 @@ public enum AnnotationLayer
2929
/// </summary>
3030
AboveSeries
3131
}
32-
}
32+
}

Source/OxyPlot/Annotations/AnnotationTextOrientation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ public enum AnnotationTextOrientation
2929
/// </summary>
3030
AlongLine
3131
}
32-
}
32+
}

Source/OxyPlot/Annotations/ArrowAnnotation.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class ArrowAnnotation : TextualAnnotation
2727
private ScreenPoint screenStartPoint;
2828

2929
/// <summary>
30-
/// Initializes a new instance of the <see cref="ArrowAnnotation" /> class.
30+
/// Initializes a new instance of the <see cref="ArrowAnnotation"/> class.
3131
/// </summary>
3232
public ArrowAnnotation()
3333
{
@@ -42,7 +42,7 @@ public ArrowAnnotation()
4242
/// <summary>
4343
/// Gets or sets the arrow direction.
4444
/// </summary>
45-
/// <remarks>Setting this property overrides the <see cref="StartPoint" /> property.</remarks>
45+
/// <remarks>Setting this property overrides the <see cref="StartPoint"/> property.</remarks>
4646
public ScreenVector ArrowDirection { get; set; }
4747

4848
/// <summary>
@@ -161,7 +161,7 @@ public override void Render(IRenderContext rc)
161161
else
162162
{
163163
var angle = Math.Atan2(d.Y, d.X);
164-
var piOver8 = Math.PI / 8;
164+
const double piOver8 = Math.PI / 8;
165165
if (angle < 3 * piOver8 && angle > -3 * piOver8)
166166
{
167167
ha = HorizontalAlignment.Right;

Source/OxyPlot/Annotations/EllipseAnnotation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class EllipseAnnotation : ShapeAnnotation
2020
private OxyRect screenRectangle;
2121

2222
/// <summary>
23-
/// Initializes a new instance of the <see cref="EllipseAnnotation" /> class.
23+
/// Initializes a new instance of the <see cref="EllipseAnnotation"/> class.
2424
/// </summary>
2525
public EllipseAnnotation()
2626
{

Source/OxyPlot/Annotations/FunctionAnnotation.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace OxyPlot.Annotations
1919
public class FunctionAnnotation : PathAnnotation
2020
{
2121
/// <summary>
22-
/// Initializes a new instance of the <see cref="FunctionAnnotation" /> class.
22+
/// Initializes a new instance of the <see cref="FunctionAnnotation"/> class.
2323
/// </summary>
2424
public FunctionAnnotation()
2525
{
@@ -104,4 +104,4 @@ protected override IList<ScreenPoint> GetScreenPoints()
104104
return points.Select(this.Transform).ToList();
105105
}
106106
}
107-
}
107+
}

Source/OxyPlot/Annotations/FunctionAnnotationType.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
// Copyright (c) 2014 OxyPlot contributors
44
// </copyright>
55
// <summary>
6-
// Defines the definition of function in a <see cref="FunctionAnnotation" />.
6+
// Defines the definition of function in a <see cref="FunctionAnnotation"/>.
77
// </summary>
88
// --------------------------------------------------------------------------------------------------------------------
99

1010
namespace OxyPlot.Annotations
1111
{
1212
/// <summary>
13-
/// Defines the definition of function in a <see cref="FunctionAnnotation" />.
13+
/// Defines the definition of function in a <see cref="FunctionAnnotation"/>.
1414
/// </summary>
1515
public enum FunctionAnnotationType
1616
{
@@ -24,4 +24,4 @@ public enum FunctionAnnotationType
2424
/// </summary>
2525
EquationY
2626
}
27-
}
27+
}

Source/OxyPlot/Annotations/ImageAnnotation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class ImageAnnotation : TransposableAnnotation
2222
private OxyRect actualBounds;
2323

2424
/// <summary>
25-
/// Initializes a new instance of the <see cref="ImageAnnotation" /> class.
25+
/// Initializes a new instance of the <see cref="ImageAnnotation"/> class.
2626
/// </summary>
2727
public ImageAnnotation()
2828
{

Source/OxyPlot/Annotations/LineAnnotation.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ namespace OxyPlot.Annotations
1212
using System;
1313
using System.Collections.Generic;
1414
using System.Linq;
15-
1615
using OxyPlot.Axes;
1716

1817
/// <summary>
@@ -21,7 +20,7 @@ namespace OxyPlot.Annotations
2120
public class LineAnnotation : PathAnnotation
2221
{
2322
/// <summary>
24-
/// Initializes a new instance of the <see cref = "LineAnnotation" /> class.
23+
/// Initializes a new instance of the <see cref="LineAnnotation"/> class.
2524
/// </summary>
2625
public LineAnnotation()
2726
{
@@ -107,7 +106,7 @@ protected override IList<ScreenPoint> GetScreenPoints()
107106
if (fx != null)
108107
{
109108
// todo: the step size should be adaptive
110-
var n = 100;
109+
const int n = 100;
111110
var dx = (this.ActualMaximumX - this.ActualMinimumX) / 100;
112111
for (int i = 0; i <= n; i++)
113112
{
@@ -118,7 +117,7 @@ protected override IList<ScreenPoint> GetScreenPoints()
118117
else
119118
{
120119
// todo: the step size should be adaptive
121-
var n = 100;
120+
const int n = 100;
122121
var dy = (this.ActualMaximumY - this.ActualMinimumY) / n;
123122
for (int i = 0; i <= n; i++)
124123
{

0 commit comments

Comments
 (0)