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

53 lines
1.2 KiB
C++

#include "stdafx.h"
#include "AecApDocManagerReactor.h"
#include "AecAcDbDatabaseReactor.h"
AecApDocManagerReactor::AecApDocManagerReactor()
{
if (acDocManager)
{
acDocManager->addReactor(this);
m_pDbReactor = new AecAcDbDatabaseReactor;
AcApDocumentIterator *pIt = acDocManager->newAcApDocumentIterator();
if (pIt != NULL)
{
for (; !pIt->done(); pIt->step())
{
AcApDocument *pDoc = pIt->document();
if (pDoc != NULL)
{
pDoc->database()->addReactor(m_pDbReactor);
}
}
delete pIt;
}
}
}
AecApDocManagerReactor::~AecApDocManagerReactor()
{
if (acDocManager)
acDocManager->removeReactor(this);
delete m_pDbReactor;
}
void AecApDocManagerReactor::documentCreated(AcApDocument *pDocCreating)
{
if (pDocCreating != NULL)
{
//acutPrintf(_T("\nAecApDocManagerReactor::documentCreated!!!"));
pDocCreating->database()->addReactor(m_pDbReactor);
}
}
void AecApDocManagerReactor::documentToBeDestroyed(AcApDocument *pDocToDestroy)
{
if (pDocToDestroy != NULL)
{
//acutPrintf(_T("\nAecApDocManagerReactor::documentToBeDestroyed!!!"));
pDocToDestroy->database()->removeReactor(m_pDbReactor);
}
}
//安装
AecApDocManagerReactor docReactor;