protected override void OnInitialized() { GlobalEventService.KeyUpEvent += GlobalEventService_KeyUpEvent; if (ShortcutKey.HasValue) { GlobalEventService.RegisterShortcutKey(ShortcutKey); } }
//private async void GlobalEventService_KeyDownEvent(object sender, KeyboardInfo e) //{ // if (ShortcutKey.HasValue && ShortcutKey.IsMatch(e.Key, e.AltKey, e.CtrlKey, e.ShiftKey)) // { // await InvokeAsync(async () => await Click.InvokeAsync(new MouseEventArgs()).ConfigureAwait(true)).ConfigureAwait(true); // } //} public void Dispose() { if (ShortcutKey.HasValue) { GlobalEventService.UnregisterShortcutKey(ShortcutKey); } GlobalEventService.KeyUpEvent -= GlobalEventService_KeyUpEvent; }
public void Dispose() { foreach (var item in Items) { if (item.ShortcutKey.HasValue) { GlobalEventService.UnregisterShortcutKey(item.ShortcutKey); } } GlobalEventService.KeyUpEvent -= GlobalEventService_KeyUpEvent; }
protected override void OnInitialized() { GlobalEventService.KeyUpEvent += GlobalEventService_KeyUpEvent; foreach (var item in Items) { if (item.ShortcutKey.HasValue) { GlobalEventService.RegisterShortcutKey(item.ShortcutKey); } } }
public TasksController() { if (Events == null) { Events = new GlobalEventService(); } if (Types == null) { Types = new TypeService(); } base.Initialize(new System.Web.Routing.RequestContext()); }
public void OnKeyUp(KeyboardInfo keyboardInfo) { GlobalEventService?.KeyUp(keyboardInfo); }
/// <summary> /// Constructeur principal /// </summary> public DatabaseGlobalEvents() { InitializeComponent(); _Service = new GlobalEventService(); ListGlobalEvents.Title = Culture.Language.DatabaseRessources.DatabaseGlobalEvents; }