-
-
Notifications
You must be signed in to change notification settings - Fork 114
/
Copy pathRotaryEncoderEventArgs.cs
32 lines (28 loc) · 1.15 KB
/
RotaryEncoderEventArgs.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using nanoFramework.Runtime.Events;
namespace Iot.Device.RotaryEncoder.Esp32
{
/// <summary>
/// EventArgs used with the RotaryEncode binding to pass event information when the Value changes.
/// </summary>
public class RotaryEncoderEventArgs : BaseEvent
{
/// <summary>Gets current value associated with the RotaryEncoder.</summary>
public double Value { get; private set; }
/// <summary>
/// Gets the milliseconds since the last pulse.
/// </summary>
public int MillisecLastPulse { get; private set; }
/// <summary>
/// Initializes a new instance of the <see cref="RotaryEncoderEventArgs" /> class.
/// </summary>
/// <param name="value">Current value associated with the rotary encoder.</param>
/// <param name="millisec">Milliseconds since last puse.</param>
public RotaryEncoderEventArgs(double value, int millisec)
{
Value = value;
MillisecLastPulse = millisec;
}
}
}