internal KeyboardUpdateHandler(ApplicationState state) { // Listen for name change changes across all processes/threads on current desktop... IntPtr hhook = SetWinEventHook(EVENT_OBJECT_NAMECHANGE, EVENT_OBJECT_NAMECHANGE, IntPtr.Zero, procDelegate, 0, 0, WINEVENT_OUTOFCONTEXT); _state = state; _instance = this; _commander = new ArduinoCommand(); _dispatcherTimer = new System.Windows.Threading.DispatcherTimer(); _dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick); _dispatcherTimer.Interval = new TimeSpan(0, 0, 0,0,50); _dispatcherTimer.Start(); }
public override void Dispose() { _instance = null; _dispatcherTimer.Stop(); }