/// <summary> /// Helper function to get digitizing or system default context. /// </summary> /// <param name="contextType_I">Use WTI_DEFCONTEXT for digital context or WTI_DEFSYSCTX for system context</param> /// <returns>Returns the default context or null on error.</returns> private static WContext GetDefaultContext(EWTICategoryIndex contextIndex_I) { WContext context = new WContext(); IntPtr buf = WMemUtils.AllocUnmanagedBuf(context.LogContext); try { int size = (int)WNativeMethods.WTInfo((uint)contextIndex_I, 0, buf); context.LogContext = WMemUtils.MarshalUnmanagedBuf <WintabLogContext>(buf, size); } catch (Exception ex) { throw new Exception("FAILED GetDefaultContext: " + ex.ToString()); } WMemUtils.FreeUnmanagedBuf(buf); return(context); }
/// <summary> /// Helper function to get digitizing or system default context. /// </summary> /// <param name="contextType_I">Use WTI_DEFCONTEXT for digital context or WTI_DEFSYSCTX for system context</param> /// <returns>Returns the default context or null on error.</returns> private static CWintabContext GetDefaultContext(EWTICategoryIndex contextIndex_I) { CWintabContext context = new CWintabContext(); IntPtr buf = CMemUtils.AllocUnmanagedBuf(context.LogContext); try { int size = (int)CWintabFuncs.WTInfo((uint)contextIndex_I, 0, buf); context.LogContext = CMemUtils.MarshalUnmanagedBuf <WintabLogContext>(buf, size); } finally { CMemUtils.FreeUnmanagedBuf(buf); } return(context); }
/// <summary> /// Helper function to get digitizing or system default context. /// </summary> /// <param name="contextType_I">Use WTI_DEFCONTEXT for digital context or WTI_DEFSYSCTX for system context</param> /// <returns>Returns the default context or null on error.</returns> private static CWintabContext GetDefaultContext(EWTICategoryIndex contextIndex_I) { CWintabContext context = new CWintabContext(); IntPtr buf = CMemUtils.AllocUnmanagedBuf(context.LogContext); try { int size = (int)CWintabFuncs.WTInfoA((uint)contextIndex_I, 0, buf); context.LogContext = CMemUtils.MarshalUnmanagedBuf <WintabLogContext>(buf, size); } catch (Exception ex) { MessageBox.Show("FAILED GetDefaultContext: " + ex.ToString()); } CMemUtils.FreeUnmanagedBuf(buf); return(context); }
/// <summary> /// Helper function to get digitizing or system default context. /// </summary> /// <param name="contextType_I">Use WTI_DEFCONTEXT for digital context or WTI_DEFSYSCTX for system context</param> /// <returns>Returns the default context or null on error.</returns> private static CWintabContext GetDefaultContext(EWTICategoryIndex contextIndex_I) { CWintabContext context = new CWintabContext(); IntPtr buf = CMemUtils.AllocUnmanagedBuf(context.LogContext); try { int size = (int)CWintabFuncs.WTInfoA((uint)contextIndex_I, 0, buf); context.LogContext = CMemUtils.MarshalUnmanagedBuf<WintabLogContext>(buf, size); } catch (Exception ex) { MessageBox.Show("FAILED GetDefaultContext: " + ex.ToString()); } CMemUtils.FreeUnmanagedBuf(buf); return context; }