-
Notifications
You must be signed in to change notification settings - Fork 0
/
ConfigProvider.cs
68 lines (63 loc) · 2.58 KB
/
ConfigProvider.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/* Copyright 2015-2016 Pascal COMBES <pascom@orange.fr>
*
* This file is part of GlobalHotKeys.
*
* GlobalHotKeys is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GlobalHotKeys is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GlobalHotKeys. If not, see <http://www.gnu.org/licenses/>
*/
using System;
namespace GlobalHotKeys
{
/// <summary>
/// Abstract base for classes providing a configuration for GlobalHotKeys.
/// </summary>
/// <para>
/// It defines a new event <see cref="NewShortcutEvent"/>, which is triggered
/// when a new shortcut is read, and the associated delegate <see cref="ShortcutHandler"/>.
/// </para>
abstract class ConfigProvider
{
/// <summary>
/// Delegate for new shortcut handling.
/// </summary>
/// <para>
/// Register you handler here. It will be triggered when a new shortcut is read.
/// </para>
/// <param name="shortcut">The shortcut which trigered the event.</param>
/// <seealso cref="NewShortcutEvent"/>
public delegate void ShortcutHandler(ShortcutData shortcut);
/// <summary>
/// Event triggered when a new shortcut is read.
/// </summary>
/// <para>
/// When this event is triggered, the handlers registered in the delegates are called.
/// </para>
/// <seealso cref="ShortcutHandler"/>
public event ShortcutHandler NewShortcutEvent;
/// \internal
/// <summary>
/// This function should be called when a new shortcut is read.
/// </summary>
/// <remarks>It just triggers the <see cref="NewShortcutEvent"/>.</remarks>
/// <param name="shortcut">The new shortcut</param>
protected void newShortcut(ShortcutData shortcut)
{
NewShortcutEvent(shortcut);
}
/// <summary>
/// Config file parsing.
/// </summary>
/// <para>This function is in charge of the parsing of the config file.</para>
public abstract void parseConfig();
}
}