Include :

- aggiunto file con classe per disabilitazione e ripristino stato precedente della impostazione di progetto modificato.
This commit is contained in:
Dario Sassi
2017-01-04 18:51:58 +00:00
parent aa375522fb
commit 1bb372cd4b
+45
View File
@@ -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 ;
} ;