Files
envi-code/SourceCode/Code2026/ThunderProof/TReactorAssociate.cpp
T
gjm 164968b62e chore
把非utf8-bom编码的cpp/h文件改为 utf8 bom 编码, msvc识别utf8编码时,如果不是bom格式的,会使用当前cp_oem来解码.
2026-10-04 00:04:20 +08:00

48 lines
920 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);
}
}