private void RegisterActionEvent <T>(ESDSDKEventType eventType, StreamDeckDispatchTypedActionMessageFunc <T> dispatchMessage) where T : IStreamDeckEventMessage { eventTypeInfo.Add(eventType, new EventTypeInfo { MessageType = typeof(T), DispatchActionMessage = (action, message) => dispatchMessage(action, (T)message) }); }
private void RegisterGlobalEvent <T>(ESDSDKEventType eventType, StreamDeckDispatchTypedGlobalEventMessageFunc <T> dispatchMessage) where T : IStreamDeckEventMessage { eventTypeInfo.Add(eventType, new EventTypeInfo { MessageType = typeof(T), DispatchGlobalEventMessage = (globalEvent, message) => dispatchMessage(globalEvent, (T)message) }); }
/// <inheritdoc /> public void MessageNoEventHandler(IStreamDeckEventMessage message, ESDSDKEventType eventType) { Log($"Message event type is not yet handled by the StreamDeck.NET library: {eventType}"); }
/// <inheritdoc /> public void MessageNoEventHandler(IStreamDeckEventMessage message, ESDSDKEventType eventType) { }
private Type CreateEventMessage(ESDSDKEventType eventType) { return(eventTypeInfo.TryGetValue(eventType, out var eventInfo) ? eventInfo.MessageType : null); }