Browse Source

Fixed more warnings.

pull/335/head
Steven Kirk 11 years ago
parent
commit
49a89ba036
  1. 12
      src/Markup/Perspex.Markup.Xaml/Parsers/SelectorGrammar.cs
  2. 30
      src/Perspex.SceneGraph/Media/Pen.cs

12
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;
}
}

30
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
{
/// <summary>
@ -15,11 +13,21 @@ namespace Perspex.Media
/// </summary>
/// <param name="brush">The brush used to draw.</param>
/// <param name="thickness">The stroke thickness.</param>
/// <param name="dashStyle">The dash style.</param>
/// <param name="dashCap">The dash cap.</param>
/// <param name="startLineCap">The start line cap.</param>
/// <param name="endLineCap">The end line cap.</param>
/// <param name="lineJoin">The line join.</param>
/// <param name="miterLimit">The miter limit.</param>
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
/// </summary>
/// <param name="color">The stroke color.</param>
/// <param name="thickness">The stroke thickness.</param>
/// <param name="dashStyle">The dash style.</param>
/// <param name="dashCap">The dash cap.</param>
/// <param name="startLineCap">The start line cap.</param>
/// <param name="endLineCap">The end line cap.</param>
/// <param name="lineJoin">The line join.</param>
/// <param name="miterLimit">The miter limit.</param>
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;

Loading…
Cancel
Save