/// <summary> /// Set the handler to be called when WT_INFOCHANGE messages are received. /// </summary> /// <param name="handler_I">WT_INFOCHANGE event handler supplied by the client.</param> public void SetInfoChangeEventHandler(EventHandler <MessageReceivedEventArgs> handler_I) { try { MessageEvents.InfoChgMessageReceived += handler_I; MessageEvents.WatchMessage(EWintabEventMessage.WT_INFOCHANGE); } catch (Exception ex) { MessageBox.Show("FAILED CWintabData.SetWTInfoChangeEventHandler: " + ex.ToString()); } }
/// <summary> /// Set the handler to be called when WT_PACKET messages are received. /// </summary> /// <param name="handler_I">WT_PACKET event handler supplied by the client.</param> public void SetWTPacketEventHandler(EventHandler <MessageReceivedEventArgs> handler_I) { try { MessageEvents.PacketMessageReceived += handler_I; MessageEvents.WatchMessage(EWintabEventMessage.WT_PACKET); MessageEvents.WatchMessage(EWintabEventMessage.WT_PACKETEXT); MessageEvents.WatchMessage(EWintabEventMessage.WT_CSRCHANGE); } catch (Exception ex) { MessageBox.Show("FAILED CWintabData.SetWTPacketEventHandler: " + ex.ToString()); } }
/// <summary> /// Initialize this data object. /// </summary> /// <param name="context_I">logical context for this data object</param> private void Init(CWintabContext context_I) { if (context_I == null) { throw new Exception("Trying to init CWintabData with null context."); } m_context = context_I; // Watch for the Wintab WT_PACKET event. MessageEvents.WatchMessage((int)EWintabEventMessage.WT_PACKET); // Watch for the Wintab WT_PACKETEXT event. MessageEvents.WatchMessage((int)EWintabEventMessage.WT_PACKETEXT); }
/// <summary> /// Set the handler to be called when WT_CTX* messages are received. /// </summary> /// <param name="handler_I">WT_CTX* event handler supplied by the client.</param> public void SetStatusEventHandler(EventHandler <MessageReceivedEventArgs> handler_I) { try { MessageEvents.StatusMessageReceived += handler_I; MessageEvents.WatchMessage(EWintabEventMessage.WT_CTXOPEN); MessageEvents.WatchMessage(EWintabEventMessage.WT_CTXCLOSE); MessageEvents.WatchMessage(EWintabEventMessage.WT_CTXUPDATE); MessageEvents.WatchMessage(EWintabEventMessage.WT_CTXOVERLAP); MessageEvents.WatchMessage(EWintabEventMessage.WT_PROXIMITY); } catch (Exception ex) { MessageBox.Show("FAILED CWintabData.SetStatusEventHandler: " + ex.ToString()); } }
/// <summary> /// Initialize this data object. /// </summary> /// <param name="context_I">logical context for this data object</param> private void Init(CWintabContext context_I) { try { if (context_I == null) { throw new Exception("Trying to init CWintabData with null context."); } m_context = context_I; // Watch for the Wintab WT_PACKET event. MessageEvents.WatchMessage((int)EWintabEventMessage.WT_PACKET); // Watch for the Wintab WT_PACKETEXT event. MessageEvents.WatchMessage((int)EWintabEventMessage.WT_PACKETEXT); } catch (Exception ex) { MessageBox.Show("FAILED CWintabData.Init: " + ex.ToString()); } }