Browse Source

Fixed some warnings.

pull/335/head
Steven Kirk 11 years ago
parent
commit
ca4c21256a
  1. 2
      src/Gtk/Perspex.Gtk/Input/GtkKeyboardDevice.cs
  2. 2
      src/Markup/Perspex.Markup/Data/ExpressionNodeBuilder.cs
  3. 19
      src/Markup/Perspex.Markup/Data/ExpressionParseException.cs
  4. 8
      src/Markup/Perspex.Markup/Data/Parsers/ArgumentListParser.cs
  5. 4
      src/Markup/Perspex.Markup/Data/Parsers/ExpressionParser.cs
  6. 2
      src/Perspex.Base/Threading/DispatcherTimer.cs
  7. 2
      src/Perspex.SceneGraph/Platform/IPlatformRenderInterface.cs
  8. 1
      src/Perspex.Styling/Styling/Selectors.cs
  9. 3
      src/Skia/Perspex.Skia/BitmapImpl.cs
  10. 8
      src/Windows/Perspex.Direct2D1/Media/TileBrushImpl.cs
  11. 2
      src/Windows/Perspex.Direct2D1/RenderTarget.cs
  12. 4
      src/Windows/Perspex.Win32/Input/WindowsKeyboardDevice.cs
  13. 2
      src/Windows/Perspex.Win32/Interop/UnmanagedMethods.cs
  14. 2
      tests/Perspex.Interactivity.UnitTests/InteractiveTests.cs

2
src/Gtk/Perspex.Gtk/Input/GtkKeyboardDevice.cs

@ -214,7 +214,7 @@ namespace Perspex.Gtk
//{ Gdk.Key.?, Key.DeadCharProcessed } //{ Gdk.Key.?, Key.DeadCharProcessed }
}; };
public static GtkKeyboardDevice Instance { get; } = new GtkKeyboardDevice(); public new static GtkKeyboardDevice Instance { get; } = new GtkKeyboardDevice();
public static Key ConvertKey(Gdk.Key key) public static Key ConvertKey(Gdk.Key key)
{ {

2
src/Markup/Perspex.Markup/Data/ExpressionNodeBuilder.cs

@ -20,7 +20,7 @@ namespace Perspex.Markup.Data
if (!reader.End) if (!reader.End)
{ {
throw new ExpressionParseException(reader, "Expected end of expression."); throw new ExpressionParseException(reader.Position, "Expected end of expression.");
} }
return node; return node;

19
src/Markup/Perspex.Markup/Data/ExpressionParseException.cs

@ -6,19 +6,26 @@ using Perspex.Markup.Data.Parsers;
namespace Perspex.Markup.Data namespace Perspex.Markup.Data
{ {
/// <summary>
/// Exception thrown when <see cref="ExpressionObserver"/> could not parse the provided
/// expression string.
/// </summary>
public class ExpressionParseException : Exception public class ExpressionParseException : Exception
{ {
internal ExpressionParseException(int column, string message) /// <summary>
/// Initializes a new instance of the <see cref="ExpressionParseException"/> class.
/// </summary>
/// <param name="column">The column position of the error.</param>
/// <param name="message">The exception message.</param>
public ExpressionParseException(int column, string message)
: base(message) : base(message)
{ {
Column = column; Column = column;
} }
internal ExpressionParseException(Reader r, string message) /// <summary>
: this(r.Position, message) /// Gets the column position at which the error occurred.
{ /// </summary>
}
public int Column { get; } public int Column { get; }
} }
} }

8
src/Markup/Perspex.Markup/Data/Parsers/ArgumentListParser.cs

@ -26,14 +26,14 @@ namespace Perspex.Markup.Data.Parsers
} }
else else
{ {
throw new ExpressionParseException(r, "Expected integer."); throw new ExpressionParseException(r.Position, "Expected integer.");
} }
r.SkipWhitespace(); r.SkipWhitespace();
if (r.End) if (r.End)
{ {
throw new ExpressionParseException(r, "Expected ','."); throw new ExpressionParseException(r.Position, "Expected ','.");
} }
else if (r.TakeIf(close)) else if (r.TakeIf(close))
{ {
@ -43,7 +43,7 @@ namespace Perspex.Markup.Data.Parsers
{ {
if (r.Take() != ',') if (r.Take() != ',')
{ {
throw new ExpressionParseException(r, "Expected ','."); throw new ExpressionParseException(r.Position, "Expected ','.");
} }
r.SkipWhitespace(); r.SkipWhitespace();
@ -57,7 +57,7 @@ namespace Perspex.Markup.Data.Parsers
} }
else else
{ {
throw new ExpressionParseException(r, "Expected ']'."); throw new ExpressionParseException(r.Position, "Expected ']'.");
} }
} }

4
src/Markup/Perspex.Markup/Data/Parsers/ExpressionParser.cs

@ -34,7 +34,7 @@ namespace Perspex.Markup.Data.Parsers
if (state == State.BeforeMember) if (state == State.BeforeMember)
{ {
throw new ExpressionParseException(r, "Unexpected end of expression."); throw new ExpressionParseException(r.Position, "Unexpected end of expression.");
} }
for (int n = 0; n < nodes.Count - 1; ++n) for (int n = 0; n < nodes.Count - 1; ++n)
@ -80,7 +80,7 @@ namespace Perspex.Markup.Data.Parsers
{ {
if (args.Count == 0) if (args.Count == 0)
{ {
throw new ExpressionParseException(r, "Indexer may not be empty."); throw new ExpressionParseException(r.Position, "Indexer may not be empty.");
} }
nodes.Add(new IndexerNode(args)); nodes.Add(new IndexerNode(args));

2
src/Perspex.Base/Threading/DispatcherTimer.cs

@ -31,7 +31,6 @@ namespace Perspex.Threading
/// Initializes a new instance of the <see cref="DispatcherTimer"/> class. /// Initializes a new instance of the <see cref="DispatcherTimer"/> class.
/// </summary> /// </summary>
/// <param name="priority">The priority to use.</param> /// <param name="priority">The priority to use.</param>
/// <param name="dispatcher">The dispatcher to use.</param>
public DispatcherTimer(DispatcherPriority priority) public DispatcherTimer(DispatcherPriority priority)
{ {
_priority = priority; _priority = priority;
@ -43,7 +42,6 @@ namespace Perspex.Threading
/// </summary> /// </summary>
/// <param name="interval">The interval at which to tick.</param> /// <param name="interval">The interval at which to tick.</param>
/// <param name="priority">The priority to use.</param> /// <param name="priority">The priority to use.</param>
/// <param name="dispatcher">The dispatcher to use.</param>
/// <param name="callback">The event to call when the timer ticks.</param> /// <param name="callback">The event to call when the timer ticks.</param>
public DispatcherTimer(TimeSpan interval, DispatcherPriority priority, EventHandler callback) : this(priority) public DispatcherTimer(TimeSpan interval, DispatcherPriority priority, EventHandler callback) : this(priority)
{ {

2
src/Perspex.SceneGraph/Platform/IPlatformRenderInterface.cs

@ -39,8 +39,6 @@ namespace Perspex.Platform
/// Creates a renderer. /// Creates a renderer.
/// </summary> /// </summary>
/// <param name="handle">The platform handle for the renderer.</param> /// <param name="handle">The platform handle for the renderer.</param>
/// <param name="width">The initial width of the render.</param>
/// <param name="height">The initial height of the render.</param>
/// <returns>An <see cref="IRenderTarget"/>.</returns> /// <returns>An <see cref="IRenderTarget"/>.</returns>
IRenderTarget CreateRenderer(IPlatformHandle handle); IRenderTarget CreateRenderer(IPlatformHandle handle);

1
src/Perspex.Styling/Styling/Selectors.cs

@ -131,7 +131,6 @@ namespace Perspex.Styling
/// <summary> /// <summary>
/// Returns a selector which matches a control with the specified property value. /// Returns a selector which matches a control with the specified property value.
/// </summary> /// </summary>
/// <typeparam name="T">The property type.</typeparam>
/// <param name="previous">The previous selector.</param> /// <param name="previous">The previous selector.</param>
/// <param name="property">The property.</param> /// <param name="property">The property.</param>
/// <param name="value">The property value.</param> /// <param name="value">The property value.</param>

3
src/Skia/Perspex.Skia/BitmapImpl.cs

@ -10,9 +10,6 @@ namespace Perspex.Skia
{ {
class BitmapImpl : PerspexHandleHolder, IRenderTargetBitmapImpl class BitmapImpl : PerspexHandleHolder, IRenderTargetBitmapImpl
{ {
private int width;
private int height;
public void Save(string fileName) public void Save(string fileName)
{ {
var ext = Path.GetExtension(fileName)?.ToLower(); var ext = Path.GetExtension(fileName)?.ToLower();

8
src/Windows/Perspex.Direct2D1/Media/TileBrushImpl.cs

@ -36,7 +36,7 @@ namespace Perspex.Direct2D1.Media
} }
protected static BrushProperties GetBrushProperties(TileBrush brush, Rect destinationRect) private static BrushProperties GetBrushProperties(TileBrush brush, Rect destinationRect)
{ {
return new BrushProperties return new BrushProperties
{ {
@ -49,7 +49,7 @@ namespace Perspex.Direct2D1.Media
}; };
} }
protected static BitmapBrushProperties GetBitmapBrushProperties(TileBrush brush) private static BitmapBrushProperties GetBitmapBrushProperties(TileBrush brush)
{ {
var tileMode = brush.TileMode; var tileMode = brush.TileMode;
@ -60,12 +60,12 @@ namespace Perspex.Direct2D1.Media
}; };
} }
protected static ExtendMode GetExtendModeX(TileMode tileMode) private static ExtendMode GetExtendModeX(TileMode tileMode)
{ {
return (tileMode & TileMode.FlipX) != 0 ? ExtendMode.Mirror : ExtendMode.Wrap; return (tileMode & TileMode.FlipX) != 0 ? ExtendMode.Mirror : ExtendMode.Wrap;
} }
protected static ExtendMode GetExtendModeY(TileMode tileMode) private static ExtendMode GetExtendModeY(TileMode tileMode)
{ {
return (tileMode & TileMode.FlipY) != 0 ? ExtendMode.Mirror : ExtendMode.Wrap; return (tileMode & TileMode.FlipY) != 0 ? ExtendMode.Mirror : ExtendMode.Wrap;
} }

2
src/Windows/Perspex.Direct2D1/RenderTarget.cs

@ -30,8 +30,6 @@ namespace Perspex.Direct2D1
/// Initializes a new instance of the <see cref="RenderTarget"/> class. /// Initializes a new instance of the <see cref="RenderTarget"/> class.
/// </summary> /// </summary>
/// <param name="hwnd">The window handle.</param> /// <param name="hwnd">The window handle.</param>
/// <param name="width">The width of the window.</param>
/// <param name="height">The height of the window.</param>
public RenderTarget(IntPtr hwnd) public RenderTarget(IntPtr hwnd)
{ {
_hwnd = hwnd; _hwnd = hwnd;

4
src/Windows/Perspex.Win32/Input/WindowsKeyboardDevice.cs

@ -10,11 +10,9 @@ namespace Perspex.Win32.Input
{ {
public class WindowsKeyboardDevice : KeyboardDevice public class WindowsKeyboardDevice : KeyboardDevice
{ {
private static readonly WindowsKeyboardDevice s_instance = new WindowsKeyboardDevice();
private readonly byte[] _keyStates = new byte[256]; private readonly byte[] _keyStates = new byte[256];
public static new WindowsKeyboardDevice Instance => s_instance; public new static WindowsKeyboardDevice Instance { get; } = new WindowsKeyboardDevice();
public InputModifiers Modifiers public InputModifiers Modifiers
{ {

2
src/Windows/Perspex.Win32/Interop/UnmanagedMethods.cs

@ -7,7 +7,7 @@ using System.Runtime.InteropServices;
using System.Text; using System.Text;
// ReSharper disable InconsistentNaming // ReSharper disable InconsistentNaming
#pragma warning disable 169 #pragma warning disable 169, 649
namespace Perspex.Win32.Interop namespace Perspex.Win32.Interop
{ {

2
tests/Perspex.Interactivity.UnitTests/InteractiveTests.cs

@ -338,8 +338,6 @@ namespace Perspex.Interactivity.UnitTests
private class TestInteractive : Interactive private class TestInteractive : Interactive
{ {
public string Name { get; set; }
public bool ClassHandlerInvoked { get; private set; } public bool ClassHandlerInvoked { get; private set; }
public IEnumerable<IVisual> Children public IEnumerable<IVisual> Children

Loading…
Cancel
Save