Esempio n. 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;
        }
Esempio n. 2
0
        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;
        }
Esempio n. 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;
        }