From 1bb372cd4b618c43df816d1fe8f4385abb5b205a Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Wed, 4 Jan 2017 18:51:58 +0000 Subject: [PATCH] Include : - aggiunto file con classe per disabilitazione e ripristino stato precedente della impostazione di progetto modificato. --- EXeSetModifiedOff.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 EXeSetModifiedOff.h diff --git a/EXeSetModifiedOff.h b/EXeSetModifiedOff.h new file mode 100644 index 0000000..102f7c5 --- /dev/null +++ b/EXeSetModifiedOff.h @@ -0,0 +1,45 @@ +//---------------------------------------------------------------------------- +// EgalTech 2017-2017 +//---------------------------------------------------------------------------- +// File : EXeSetModifiedOff.h Data : 04.01.17 Versione : 1.6x4 +// Contenuto : Dichiarazione classe per disabilitazione temporanea +// impostazione progetto modificato. +// +// +// Modifiche : 04.01.17 DS Creazione modulo. +// +// +//---------------------------------------------------------------------------- + +#pragma once + +#include "/EgtDev/Include/EXeExecutor.h" + +//---------------------------------------------------------------------------- +class SetModifiedOff +{ + public : + explicit SetModifiedOff( void) { + m_bOldMod = ExeGetEnableModified() ; + ExeDisableModified() ; + m_nOldCtx = ExeGetCurrentContext() ; + } + ~SetModifiedOff( void) { + Reset() ; + } + void Reset( void) { + if ( ! m_bOldMod) + return ; + int nCurrCtx = ExeGetCurrentContext() ; + if ( nCurrCtx != m_nOldCtx) + ExeSetCurrentContext( m_nOldCtx) ; + ExeEnableModified() ; + if ( nCurrCtx != m_nOldCtx) + ExeSetCurrentContext( nCurrCtx) ; + m_bOldMod = false ; + } + + private : + bool m_bOldMod ; + int m_nOldCtx ; +} ;