Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.GrammaticalOptimization/SharpVectorDom/Events/KeyboardEvent.cs @ 13237

Last change on this file since 13237 was 12762, checked in by aballeit, 9 years ago

#2283 GUI updates, Tree-chart, MCTS Version 2 (prune leaves)

File size: 3.3 KB
Line 
1using System;
2
3using SharpVectors.Dom.Views;
4
5namespace SharpVectors.Dom.Events
6{
7  /// <summary>
8  /// Summary description for KeyboardEvent.
9  /// </summary>
10  public class KeyboardEvent : UiEvent, IKeyboardEvent
11  {
12    #region Private Fields
13   
14    private string keyIdentifier;
15    private KeyLocationCode keyLocation;
16    private bool ctrlKey;
17    private bool shiftKey;
18    private bool altKey;
19    private bool metaKey;
20    private bool altGraphKey;
21   
22    #endregion
23   
24    #region Constructors
25   
26    public KeyboardEvent()
27    {
28    }
29   
30    public KeyboardEvent(
31      string eventType,
32      bool bubbles,
33      bool cancelable,
34      IAbstractView view,
35      string keyIdentifier,
36      KeyLocationCode keyLocation,
37      bool ctrlKey,
38      bool shiftKey,
39      bool altKey,
40      bool metaKey,
41      bool altGraphKey)
42    {
43      InitKeyboardEvent(
44        eventType, bubbles, cancelable, view,
45        keyIdentifier, keyLocation,
46        ctrlKey, shiftKey, altKey, metaKey, altGraphKey);
47    }
48   
49    public KeyboardEvent(
50      string namespaceUri,
51      string eventType,
52      bool bubbles,
53      bool cancelable,
54      IAbstractView view,
55      string keyIdentifier,
56      KeyLocationCode keyLocation,
57      bool ctrlKey,
58      bool shiftKey,
59      bool altKey,
60      bool metaKey,
61      bool altGraphKey)
62    {
63      InitKeyboardEventNs(
64        namespaceUri, eventType, bubbles, cancelable, view,
65        keyIdentifier, keyLocation,
66        ctrlKey, shiftKey, altKey, metaKey, altGraphKey);
67    }
68   
69    #endregion
70   
71    #region IKeyboardEvent interface
72   
73    #region Public Properties
74   
75    public string KeyIdentifier
76    {
77      get
78      {
79        return keyIdentifier;
80      }
81    }
82   
83    public KeyLocationCode KeyLocation
84    {
85      get
86      {
87        return keyLocation;
88      }
89    }
90   
91    public bool CtrlKey
92    {
93      get
94      {
95        return ctrlKey;
96      }
97    }
98   
99    public bool ShiftKey
100    {
101      get
102      {
103        return shiftKey;
104      }
105    }
106   
107    public bool AltKey
108    {
109      get
110      {
111        return altKey;
112      }
113    }
114   
115    public bool MetaKey
116    {
117      get
118      {
119        return metaKey;
120      }
121    }
122   
123    public bool AltGraphKey
124    {
125      get
126      {
127        return altGraphKey;
128      }
129    }
130   
131    #endregion
132   
133    #region Public Methods
134   
135    public void InitKeyboardEvent(
136      string eventType,
137      bool bubbles,
138      bool cancelable,
139      IAbstractView view,
140      string keyIdentifier,
141      KeyLocationCode keyLocation,
142      bool ctrlKey,
143      bool shiftKey,
144      bool altKey,
145      bool metaKey,
146      bool altGraphKey)
147    {
148      InitUiEvent(eventType, bubbles, cancelable, view, 0);
149     
150      this.keyIdentifier = keyIdentifier;
151      this.keyLocation = keyLocation;
152      this.ctrlKey = ctrlKey;
153      this.shiftKey = shiftKey;
154      this.altKey = altKey;
155      this.metaKey = metaKey;
156      this.altGraphKey = altGraphKey;
157    }
158   
159    public void InitKeyboardEventNs(
160      string namespaceUri,
161      string eventType,
162      bool bubbles,
163      bool cancelable,
164      IAbstractView view,
165      string keyIdentifier,
166      KeyLocationCode keyLocation,
167      bool ctrlKey,
168      bool shiftKey,
169      bool altKey,
170      bool metaKey,
171      bool altGraphKey)
172    {
173      InitUiEventNs(namespaceUri, eventType, bubbles, cancelable, view, 0);
174     
175      this.keyIdentifier = keyIdentifier;
176      this.keyLocation = keyLocation;
177      this.ctrlKey = ctrlKey;
178      this.shiftKey = shiftKey;
179      this.altKey = altKey;
180      this.metaKey = metaKey;
181      this.altGraphKey = altGraphKey;
182    }
183   
184    #endregion
185   
186    #endregion
187  }
188}
Note: See TracBrowser for help on using the repository browser.