www.mxdraw.com
内容索引主面
前一个向上下一个
McDbObjectReactor 类

数据库中对象事件通知反应器 例如:

    //从该类继一个自己的类

    class IntelliRealTimeZoomObjectReactor : public  McDbObjectReactor
    {
    public:
        virtual void    openedForModify(const McDbObject* dbObj);

        static IntelliRealTimeZoomObjectReactor s_reactor;
    };
    // 
    IntelliRealTimeZoomObjectReactor 
    IntelliRealTimeZoomObjectReactor::s_reactor;
    void    IntelliRealTimeZoomObjectReactor::openedForModify(const McDbObject* dbObj)
    {
        McApDocument* pDoc = dbObj->database()->GetDocument();
        if(pDoc != NULL)
        {
            IntelliRealTimeZoom* pRealTimZoom = IntelliCmdDocDataContainer::Instance().docData(pDoc)->RealTimeZoom();
            pRealTimZoom->ReSetData();
        }
    }

    // 调用McDbObject::addReactor,注册反应器
    spViewport->addReactor(&(IntelliRealTimeZoomObjectReactor::s_reactor) );

    // 调用McDbObject::removeReactor(),注消反应器
    spViewport->removeReactor(&(IntelliRealTimeZoomObjectReactor::s_reactor) );
C++
class McDbObjectReactor : public McRxObject;

dbmain.h

Copyright (c) 2010. All rights reserved.
你认为该帮助怎么样? 发送反馈信息!