void
ArxDbgUiTdcSysReactors::attachDbReactorToAll()
{
    if (m_dbReactor) {
		AcDbDatabase* tmpDb;
		AcDbVoidPtrArray dbPtrs;
		ArxDbgUtils::getAllDatabases(dbPtrs);

        acutPrintf(_T("\nAttaching Database Reactor to all active databases..."));

		int len = dbPtrs.length();
		for (int i=0; i<len; i++) {
			tmpDb = static_cast<AcDbDatabase*>(dbPtrs[i]);
		    tmpDb->addReactor(m_dbReactor);
		}
	}
}
Пример #2
0
//
//	Attach the database reactor if one isn't attached already.  
//	Then, start up the dialog.
//
//
void attachDbReactor(AcDbDatabase* pDb)
{
	if(gbDisplayDialog)
	{
		AcDbDatabase* pWkDb = acdbHostApplicationServices()->workingDatabase();
		assert(pWkDb == pDb);
		AcDbDatabase* pCurDb = curDoc()->database();
		assert(pCurDb == pDb);
		acDocManager->lockDocument(curDoc(), AcAp::kWrite);
    
		gpDbReactor = new CDbModReactor();
		pWkDb->addReactor(gpDbReactor);
		acutPrintf("\nAttached CDbModReactor to the current database.\n");     
		
		acDocManager->unlockDocument(curDoc());
		acedPostCommandPrompt();
	}
	else
		endDlg();
}