Beispiel #1
0
        internal EditLogger(ISDUTExtension ext, Transaction current, TransactionConfig config, QAManager qaManager)
        {
            chg_evnt = new IEditEvents_OnChangeFeatureEventHandler(LogFeatureUpdate);
            crt_evnt = new IEditEvents_OnCreateFeatureEventHandler(LogFeatureInsert);
            del_evnt = new IEditEvents_OnDeleteFeatureEventHandler(LogFeatureDelete);

            transaction = current;
            this.config = config;
            this.qaManager = qaManager;

            editor = ext.Editor;

            ((IEditEvents_Event)editor).OnChangeFeature += chg_evnt;
            ((IEditEvents_Event)editor).OnCreateFeature += crt_evnt;
            ((IEditEvents_Event)editor).OnDeleteFeature += del_evnt;
        }
Beispiel #2
0
        public void Start()
        {
            try
            {
                //Debug.WriteLine("\t-> 1");

                util.Logger.Write(this.Name + " starting up.", util.Logger.LogLevel.Info);
                util.Logger.Write(this.Name + " version number: " + GetType().Assembly.GetName().Version.ToString());
                util.Logger.LoggingLevel = util.Logger.LogLevel.Debug;

                this._defaults = new util.SystemDefaults();

                //Added to avoid passing isdut.mxd as a command-line argument.
                //this._app.NewDocument(false, this._defaults.get_Default("tm.temp"));

                // event init

                //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;

                // TM init
                this._tm = new TransactionManager(this._app, this);

                // QA init
                this._qa = new QAManager(this._app);

                UID pUID;
                pUID = new UIDClass();

                pUID.Value = "esriEditor.Editor";
                IEditor pEditor = (IEditor)_app.FindExtensionByCLSID(pUID);

                //m_OnStartEditing = new IEditEvents_OnStartEditingEventHandler(OnStartEditing_Handler2);
                //add delgates to the appropriate events to enable listening
                //((IEditEvents_Event)pEditor).OnStartEditing += m_OnStartEditing;
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.Message + "\n" + ex.StackTrace);

            }
        }
Beispiel #3
0
        public void Shutdown()
        {
            util.Logger.Write(this.Name + " shutting down.", util.Logger.LogLevel.Info);

            try
            {
                IDocumentEvents_Event ide = null;
                if (this.MxDocument != null)
                {
                    ide = ((IDocumentEvents_Event)this.MxDocument);
                    ide.CloseDocument -= this.doc_close;
                    ide.NewDocument -= this.new_doc;
                    ide.OpenDocument -= this.open_doc;
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.Message + "\n" + ex.StackTrace);
            }

            util.Utils.Release(_pMxDoc); // TODO: do we pull this out later (May 28-07)
            _pMxDoc = null;

            // TM cleanup
            this._tm = null;

            // QA cleanup
            this._qa.Release();
            this._qa = null;

            this._app = null;
        }