예제 #1
0
        protected override void OnStartup()
        {
            s_extension = this;
            Initialize();

            UID editorUID = new UID();

            editorUID.Value = "esriEditor.Editor";

            this.m_editor = ArcMap.Application.FindExtensionByCLSID(editorUID) as IEditor;

            Events.OnStartEditing += new IEditEvents_OnStartEditingEventHandler(Events_OnStartEditing);
            Events.OnStopEditing  += new IEditEvents_OnStopEditingEventHandler(Events_OnStopEditing);

            m_map = ArcMap.Document.FocusMap;

            try
            {
                if (CMedToolsSubs.ensureSettingsFile())
                {
                    setConstVals();
                }
                else
                {
                    System.Windows.Forms.MessageBox.Show(SConst.OrganizationName + " GIS Error: settings not found");
                    //    //this.State = ExtensionState.Disabled;
                }
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message, "STARTUP ERROR!", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
            }
        }
예제 #2
0
        protected override void OnShutdown()
        {
            Uninitialize();

            m_map       = null;
            s_extension = null;

            base.OnShutdown();
        }