/// <summary> /// Restore the tablet control functions and close Wintab context. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ExtensionTestForm_FormClosing(object sender, FormClosingEventArgs e) { if (mLogContext != null && mLogContext.HCtx != 0) { RemoveOverridesForTablet(mTabletIndexDefault); mLogContext.Close(); } }
protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { winTabData = null; } winTabContext?.Close(); disposedValue = true; } }
/////////////////////////////////////////////////////////////////////// public void CloseCurrentContext() { try { if (m_logContext != null) { m_logContext.Close(); m_logContext = null; m_wtData = null; } } catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.ToString()); } }
private void CloseCurrentContext() { try { if (m_logContext != null) { m_logContext.Close(); m_logContext = null; m_wtData = null; } } catch (Exception ex) { Log.Fatal(ex.Message); } }
/////////////////////////////////////////////////////////////////////// private void CloseCurrentContext() { try { TraceMsg("Closing context...\n"); if (m_logContext != null) { m_logContext.Close(); m_logContext = null; m_wtData = null; } } catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.ToString()); } }
/// <summary> /// Restore the tablet control functions and close Wintab context. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ExtensionTestForm_FormClosing(object sender, FormClosingEventArgs e) { if (m_wtData != null) { m_wtData.RemoveWTPacketEventHandler(MyWTPacketEventHandler); m_wtData = null; } if (mLogContext != null && mLogContext.HCtx != 0) { foreach (var tabletIdx in mTabletList) { RemoveOverridesForTablet(tabletIdx); } mLogContext.Close(); } }
/////////////////////////////////////////////////////////////////////// private void Test_DataPacketQueueSize() { bool status = false; UInt32 numPackets = 0; CWintabContext logContext = null; try { logContext = OpenTestDigitizerContext(); //logContext = OpenTestDigitizerContext(m_TABEXTX, m_TABEXTY); if (logContext == null) { TraceMsg("Test_DataPacketQueueSize: FAILED OpenTestDigitizerContext - bailing out...\n"); return; } CWintabData wtData = new CWintabData(logContext); TraceMsg("Creating CWintabData object: " + (wtData != null ? "PASSED" : "FAILED") + "\n"); if (wtData == null) { throw new Exception("Could not create CWintabData object."); } numPackets = wtData.GetPacketQueueSize(); TraceMsg("Initial packet queue size: " + numPackets + "\n"); status = wtData.SetPacketQueueSize(17); TraceMsg("Setting packet queue size: " + (status ? "PASSED" : "FAILED") + "\n"); numPackets = wtData.GetPacketQueueSize(); TraceMsg("Modified packet queue size: " + numPackets + "\n"); } catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.ToString()); } finally { if (logContext != null) { status = logContext.Close(); TraceMsg("Context Close: " + (status ? "PASSED" : "FAILED") + "\n"); } } }
private void CloseCurrentContext() { try { Console.WriteLine("Closing context...\n"); if (m_logContext != null) { m_logContext.Close(); m_logContext = null; m_wtData = null; } } catch (Exception ex) { System.Windows.Forms.MessageBox.Show(new Form() { WindowState = FormWindowState.Maximized, TopMost = true }, ex.ToString()); } }
public void CaptureStop() { if (!IsRunning) { return; } try { if (context != null) { context.Close(); } IsRunning = false; for (int i = 0; i < taskList.Count; ++i) { taskList[i].Stop(); } taskList.Clear(); } catch (Exception ex) { } context = null; data = null; }
/////////////////////////////////////////////////////////////////////// private void Test_Context() { bool status = false; CWintabContext logContext = null; try { logContext = OpenTestDigitizerContext(); if (logContext == null) { TraceMsg("Test_Context: FAILED OpenTestDigitizerContext - bailing out...\n"); return; } status = logContext.Enable(true); TraceMsg("Context Enable: " + (status ? "PASSED" : "FAILED") + "\n"); status = logContext.SetOverlapOrder(false); TraceMsg("Context SetOverlapOrder to bottom: " + (status ? "PASSED" : "FAILED") + "\n"); status = logContext.SetOverlapOrder(true); TraceMsg("Context SetOverlapOrder to top: " + (status ? "PASSED" : "FAILED") + "\n"); TraceMsg("Modified Context:\n"); TraceMsg(" Name: " + logContext.Name + "\n"); TraceMsg(" Options: " + logContext.Options + "\n"); TraceMsg(" Status: " + logContext.Status + "\n"); TraceMsg(" Locks: " + logContext.Locks + "\n"); TraceMsg(" MsgBase: " + logContext.MsgBase + "\n"); TraceMsg(" Device: " + logContext.Device + "\n"); TraceMsg(" PktRate: 0x" + logContext.PktRate.ToString("x") + "\n"); TraceMsg(" PktData: 0x" + ((uint)logContext.PktData).ToString("x") + "\n"); TraceMsg(" PktMode: 0x" + ((uint)logContext.PktMode).ToString("x") + "\n"); TraceMsg(" MoveMask: " + logContext.MoveMask + "\n"); TraceMsg(" BZtnDnMask: 0x" + logContext.BtnDnMask.ToString("x") + "\n"); TraceMsg(" BtnUpMask: 0x" + logContext.BtnUpMask.ToString("x") + "\n"); TraceMsg(" InOrgX: " + logContext.InOrgX + "\n"); TraceMsg(" InOrgY: " + logContext.InOrgY + "\n"); TraceMsg(" InOrgZ: " + logContext.InOrgZ + "\n"); TraceMsg(" InExtX: " + logContext.InExtX + "\n"); TraceMsg(" InExtY: " + logContext.InExtY + "\n"); TraceMsg(" InExtZ: " + logContext.InExtZ + "\n"); TraceMsg(" OutOrgX: " + logContext.OutOrgX + "\n"); TraceMsg(" OutOrgY: " + logContext.OutOrgY + "\n"); TraceMsg(" OutOrgZ: " + logContext.OutOrgZ + "\n"); TraceMsg(" OutExtX: " + logContext.OutExtX + "\n"); TraceMsg(" OutExtY: " + logContext.OutExtY + "\n"); TraceMsg(" OutExtZ: " + logContext.OutExtZ + "\n"); TraceMsg(" SensX: " + logContext.SensX + "\n"); TraceMsg(" SensY: " + logContext.SensY + "\n"); TraceMsg(" SensZ: " + logContext.SensZ + "\n"); TraceMsg(" SysMode: " + logContext.SysMode + "\n"); TraceMsg(" SysOrgX: " + logContext.SysOrgX + "\n"); TraceMsg(" SysOrgY: " + logContext.SysOrgY + "\n"); TraceMsg(" SysExtX: " + logContext.SysExtX + "\n"); TraceMsg(" SysExtY: " + logContext.SysExtY + "\n"); TraceMsg(" SysSensX: " + logContext.SysSensX + "\n"); TraceMsg(" SysSensY: " + logContext.SysSensY + "\n"); } catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.ToString()); } finally { if (logContext != null) { status = logContext.Close(); TraceMsg("Context Close: " + (status ? "PASSED" : "FAILED") + "\n"); } } }