diff --git a/src/Markup/Perspex.Markup.Xaml/Parsers/SelectorGrammar.cs b/src/Markup/Perspex.Markup.Xaml/Parsers/SelectorGrammar.cs
index ba3e2fa5ac..1823995321 100644
--- a/src/Markup/Perspex.Markup.Xaml/Parsers/SelectorGrammar.cs
+++ b/src/Markup/Perspex.Markup.Xaml/Parsers/SelectorGrammar.cs
@@ -3,10 +3,12 @@
using System.Collections.Generic;
using System.Globalization;
-using System.Linq;
-using Perspex.Styling;
using Sprache;
+// Don't need to override GetHashCode as the ISyntax objects will not be stored in a hash; the
+// only reason they have overridden Equals methods is for unit testing.
+#pragma warning disable 659
+
namespace Perspex.Markup.Xaml.Parsers
{
internal class SelectorGrammar
@@ -129,7 +131,8 @@ namespace Perspex.Markup.Xaml.Parsers
public override bool Equals(object obj)
{
- return obj is OfTypeSyntax && ((OfTypeSyntax)obj).TypeName == TypeName;
+ var other = obj as OfTypeSyntax;
+ return other != null && other.TypeName == TypeName && other.Xmlns == Xmlns;
}
}
@@ -141,7 +144,8 @@ namespace Perspex.Markup.Xaml.Parsers
public override bool Equals(object obj)
{
- return obj is IsSyntax && ((IsSyntax)obj).TypeName == TypeName;
+ var other = obj as IsSyntax;
+ return other != null && other.TypeName == TypeName && other.Xmlns == Xmlns;
}
}
diff --git a/src/Perspex.SceneGraph/Media/Pen.cs b/src/Perspex.SceneGraph/Media/Pen.cs
index b813392ccd..cc14ae29d6 100644
--- a/src/Perspex.SceneGraph/Media/Pen.cs
+++ b/src/Perspex.SceneGraph/Media/Pen.cs
@@ -1,8 +1,6 @@
// Copyright (c) The Perspex Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information.
-using System.Collections.Generic;
-
namespace Perspex.Media
{
///
@@ -15,11 +13,21 @@ namespace Perspex.Media
///
/// The brush used to draw.
/// The stroke thickness.
+ /// The dash style.
+ /// The dash cap.
+ /// The start line cap.
+ /// The end line cap.
+ /// The line join.
+ /// The miter limit.
public Pen(
Brush brush,
double thickness = 1.0,
- DashStyle dashStyle = null, PenLineCap dashCap = PenLineCap.Flat, PenLineCap startLineCap = PenLineCap.Flat,
- PenLineCap endLineCap = PenLineCap.Flat, PenLineJoin lineJoin = PenLineJoin.Miter, double miterLimit = 10.0)
+ DashStyle dashStyle = null,
+ PenLineCap dashCap = PenLineCap.Flat,
+ PenLineCap startLineCap = PenLineCap.Flat,
+ PenLineCap endLineCap = PenLineCap.Flat,
+ PenLineJoin lineJoin = PenLineJoin.Miter,
+ double miterLimit = 10.0)
{
Brush = brush;
Thickness = thickness;
@@ -36,11 +44,21 @@ namespace Perspex.Media
///
/// The stroke color.
/// The stroke thickness.
+ /// The dash style.
+ /// The dash cap.
+ /// The start line cap.
+ /// The end line cap.
+ /// The line join.
+ /// The miter limit.
public Pen(
uint color,
double thickness = 1.0,
- DashStyle dashStyle = null, PenLineCap dashCap = PenLineCap.Flat, PenLineCap startLineCap = PenLineCap.Flat,
- PenLineCap endLineCap = PenLineCap.Flat, PenLineJoin lineJoin = PenLineJoin.Miter, double miterLimit = 10.0)
+ DashStyle dashStyle = null,
+ PenLineCap dashCap = PenLineCap.Flat,
+ PenLineCap startLineCap = PenLineCap.Flat,
+ PenLineCap endLineCap = PenLineCap.Flat,
+ PenLineJoin lineJoin = PenLineJoin.Miter,
+ double miterLimit = 10.0)
{
Brush = new SolidColorBrush(color);
Thickness = thickness;