IButtonTranslator.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
33
34
35
#define MF3

#if MF3
using Microsoft.SPOT.Hardware;
#else
using
Microsoft.SPOT.Input;
#endif

namespace UAM.InformatiX.SPOT.Input
{
/// <summary>
/// Defines methods which support translating the buttons into textual or numeric input.
/// </summary>
public interface IButtonTranslator
{
/// <summary>
/// Translates a button press to the textual input.
/// </summary>
/// <param name="button">The button which was pressed.</param>
/// <param name="pressedCount">The number of presses.</param>
/// <param name="text">The associated textual input for this button and number of presses.</param>
/// <returns>true if associated input was found and <paramref name="text"/> is valid; otherwise false.</returns>
bool GetText(Button button, int pressedCount, out string text);

/// <summary>
/// Translates a button press to the numeric input.
/// There can be only one number per button.
/// </summary>
/// <param name="button">The button which was pressed.</param>
/// <param name="number">The associated numeric input for this button.</param>
/// <returns>true if associated input was found and <paramref name="number"/> is valid; otherwise false.</returns>
bool GetNumber(Button button, out int number);
}
}