Browse Source

Added some documentation.

pull/488/head
Steven Kirk 10 years ago
parent
commit
9c1efd2f99
  1. 32
      src/Perspex.Input/Raw/RawInputEventArgs.cs
  2. 29
      src/Perspex.Input/Raw/RawMouseEventArgs.cs

32
src/Perspex.Input/Raw/RawInputEventArgs.cs

@ -5,8 +5,22 @@ using System;
namespace Perspex.Input.Raw
{
/// <summary>
/// A raw input event.
/// </summary>
/// <remarks>
/// Raw input events are sent from the windowing subsystem to the <see cref="InputManager"/>
/// for processing: this gives an application the opportunity to pre-process the event. After
/// pre-processing they are consumed by the relevant <see cref="Device"/> and turned into
/// standard Perspex events.
/// </remarks>
public class RawInputEventArgs : EventArgs
{
/// <summary>
/// Initializes a new instance of the <see cref="RawInputEventArgs"/> class.
/// </summary>
/// <param name="device">The associated device.</param>
/// <param name="timestamp">The event timestamp.</param>
public RawInputEventArgs(IInputDevice device, uint timestamp)
{
Contract.Requires<ArgumentNullException>(device != null);
@ -15,8 +29,24 @@ namespace Perspex.Input.Raw
Timestamp = timestamp;
}
public IInputDevice Device { get; private set; }
/// <summary>
/// Gets the associated device.
/// </summary>
public IInputDevice Device { get; }
/// <summary>
/// Gets or sets a value indicating whether the event was handled.
/// </summary>
/// <remarks>
/// If an event is not marked handled after processing via the
/// <see cref="InputManager"/>, then it will be passed on to the underlying OS for
/// handling.
/// </remarks>
public bool Handled { get; set; }
/// <summary>
/// Gets the timestamp associated with the event.
/// </summary>
public uint Timestamp { get; private set; }
}
}

29
src/Perspex.Input/Raw/RawMouseEventArgs.cs

@ -18,14 +18,27 @@ namespace Perspex.Input.Raw
Wheel,
}
/// <summary>
/// A raw mouse event.
/// </summary>
public class RawMouseEventArgs : RawInputEventArgs
{
/// <summary>
/// Initializes a new instance of the <see cref="RawMouseEventArgs"/> class.
/// </summary>
/// <param name="device">The associated device.</param>
/// <param name="timestamp">The event timestamp.</param>
/// <param name="root">The root from which the event originates.</param>
/// <param name="type">The type of the event.</param>
/// <param name="position">The mouse position, in client DIPs.</param>
/// <param name="inputModifiers">The input modifiers.</param>
public RawMouseEventArgs(
IInputDevice device,
uint timestamp,
IInputRoot root,
RawMouseEventType type,
Point position, InputModifiers inputModifiers)
Point position,
InputModifiers inputModifiers)
: base(device, timestamp)
{
Contract.Requires<ArgumentNullException>(device != null);
@ -37,12 +50,24 @@ namespace Perspex.Input.Raw
InputModifiers = inputModifiers;
}
public IInputRoot Root { get; private set; }
/// <summary>
/// Gets the root from which the event originates.
/// </summary>
public IInputRoot Root { get; }
/// <summary>
/// Gets the mouse position, in client DIPs.
/// </summary>
public Point Position { get; set; }
/// <summary>
/// Gets the type of the event.
/// </summary>
public RawMouseEventType Type { get; private set; }
/// <summary>
/// Gets the input modifiers.
/// </summary>
public InputModifiers InputModifiers { get; private set; }
}
}

Loading…
Cancel
Save