Files
envi-code/SourceCode/Code2026/ThunderProof/TReactorAssociate.cpp
T
2026-09-28 15:28:50 +08:00

48 lines
913 B
C++

#include "stdafx.h"
#include "TReactorAssociate.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
TReactorAssociate::TReactorAssociate(AcDbDatabase* pOwnerDb, AcDbDatabaseReactor* pReactor)
{
m_pOwnerDb = pOwnerDb;
m_pReactor = pReactor;
if (m_pOwnerDb != NULL && m_pReactor != NULL)
{
m_pOwnerDb->removeReactor(m_pReactor);
}
}
TReactorAssociate::~TReactorAssociate()
{
if (m_pOwnerDb != NULL && m_pReactor != NULL)
{
m_pOwnerDb->addReactor(m_pReactor);
}
}
//TCurDocumentLock
//////////////////////////////////////////////////////////////////////////
TCurDocumentLock::TCurDocumentLock()
{
m_pDoc = acDocManager->curDocument();
if (acDocManager->lockDocument(m_pDoc, AcAp::kWrite) != Acad::eOk)
{
// Ëřś¨Ę§°Ü
m_pDoc = NULL;
}
}
TCurDocumentLock::~TCurDocumentLock()
{
if (m_pDoc != NULL)
{
acDocManager->unlockDocument(m_pDoc);
}
}