コード例 #1
0
        //Wiring.
        private void WireDocumentEvents(ESRI.ArcGIS.Framework.IDocument myDocument)
        {
            m_docEvents = myDocument as IDocumentEvents_Event;
            //Safer wiring
            m_docNewHandler          = new IDocumentEvents_NewDocumentEventHandler(OnNewDocument);
            m_docEvents.NewDocument += m_docNewHandler;

            m_docOpenHandler          = new IDocumentEvents_OpenDocumentEventHandler(OnOpenDocument);
            m_docEvents.OpenDocument += m_docOpenHandler;
        }
コード例 #2
0
ファイル: ISDUTExtension.cs プロジェクト: EAWCS1/SUITT
        public void ActivateDocumentEvents()
        {
            this.doc_close = new IDocumentEvents_CloseDocumentEventHandler(StoreTransactionToMap);
            this.new_doc = new IDocumentEvents_NewDocumentEventHandler(LoadTransactionFromMap);
            this.open_doc = new IDocumentEvents_OpenDocumentEventHandler(LoadTransactionFromMap);

            _pMxDoc = this._app.Document as IMxDocument;

            IDocumentEvents_Event ide = _pMxDoc as IDocumentEvents_Event;

            ide.CloseDocument += this.doc_close;
            ide.NewDocument += this.new_doc;
            ide.OpenDocument += this.open_doc;
        }
コード例 #3
0
        /// <summary>
        /// wireup a handler to the document's close event so we can do some work before we
        /// exit
        /// </summary>
        private void WireDocumentEvents(ESRI.ArcGIS.Framework.IDocument ThisDocument)
        {
            UnWireDocumentEvents(ThisDocument);

            OnCloseDocument_EvntHndlr = new IDocumentEvents_CloseDocumentEventHandler
                (NPSEventHandlers.CloseMxDocument);
            ((IDocumentEvents_Event)ThisDocument).CloseDocument += OnCloseDocument_EvntHndlr;

            OnOpenDocument_EvntHndlr = new IDocumentEvents_OpenDocumentEventHandler
              (NPSEventHandlers.OpenMxDocument);
            ((IDocumentEvents_Event)ThisDocument).OpenDocument += OnOpenDocument_EvntHndlr;
        }