public AddPointSplitLine()
 {
     ConfigUtil.type = "water";
     // Get the editor
     m_editor      = ArcMap.Editor as IEditor3;
     m_editEvents  = m_editor as IEditEvents_Event;
     m_editEvents5 = m_editor as IEditEvents5_Event;
     m_editEvents2 = m_editor as IEditEvents2_Event;
 }
        public void Shutdown()
        {
            // persist osm editor specific information like the osm base url, etc.
            OSMGPFactory.StoreOSMEditorSettings(m_editorConfigurationSettings);

            m_editEvents.OnDeleteFeature -= new IEditEvents_OnDeleteFeatureEventHandler(m_editEvents_OnDeleteFeature);
            m_editEvents.OnChangeFeature -= new IEditEvents_OnChangeFeatureEventHandler(m_editEvents_OnChangeFeature);
            m_editEvents.OnCreateFeature -= new IEditEvents_OnCreateFeatureEventHandler(m_editEvents_OnCreateFeature);
            m_editEvents.OnStartEditing  -= new IEditEvents_OnStartEditingEventHandler(m_editEvents_OnStartEditing);

            m_editEvents2 = null;
            m_editEvents  = null;
            m_editor3     = null;
            m_application = null;
        }
        protected override void OnStartup()
        {
            //AdjustmentDockWindow pDock=

            Utilities UTIL = new Utilities();

            s_extension       = this;
            m_SpiralIsPending = false; //initialize false
            try
            {
                string sDesktopVers = UTIL.GetDesktopVersionFromRegistry();
                if (sDesktopVers.Trim() == "")
                {
                    sDesktopVers = "Desktop10.0";
                }
                else
                {
                    sDesktopVers = "Desktop" + sDesktopVers;
                }

                string sValues = UTIL.ReadFromRegistry(RegistryHive.CurrentUser,
                                                       "Software\\ESRI\\" + sDesktopVers + "\\ArcMap\\Cadastral\\AddIn.ParcelEditHelper",
                                                       "Options", false);

                string[] Values          = sValues.Split(',');
                string   sVal            = Values[0];
                string   sFieldName      = Values[1];
                bool     bUseFieldRecord = false;

                if (sVal.Trim() != "")
                {
                    bUseFieldRecord = ((sVal.ToUpper().Trim()) == "1");
                }

                s_extension.FieldName     = sFieldName;
                s_extension.RecordToField = bUseFieldRecord;
            }
            catch
            {}

            m_editEvents  = ArcMap.Editor as IEditEvents_Event;
            m_editEvents2 = ArcMap.Editor as IEditEvents2_Event;
            m_editEvents.OnStartEditing += new IEditEvents_OnStartEditingEventHandler(m_editEvents_OnStartEditing);
            m_editEvents.OnStopEditing  += new IEditEvents_OnStopEditingEventHandler(m_editEvents_OnStopEditing);
            m_editEvents2.OnVertexAdded += new IEditEvents2_OnVertexAddedEventHandler(OnVertexAdded);
            //      m_editEvents2.OnVertexAdded += OnVertexAdded;
        }
        public void Startup(ref object initializationData)
        {
            try
            {
                m_application = initializationData as IApplication;
                if (m_application == null)
                    return;

                ISpatialReferenceFactory spatialReferenceFactory = new SpatialReferenceEnvironmentClass() as ISpatialReferenceFactory;
                m_wgs84 = spatialReferenceFactory.CreateGeographicCoordinateSystem((int)esriSRGeoCSType.esriSRGeoCS_WGS1984) as ISpatialReference;

                //Get the editor.
                UID editorUid = new UID();
                editorUid.Value = "esriEditor.Editor";
                m_editor3 = m_application.FindExtensionByCLSID(editorUid) as IEditor3;
                m_editEvents2 = m_editor3 as IEditEvents2_Event;
                m_editEvents = m_editor3 as IEditEvents_Event;

                m_editEvents.OnCreateFeature += new IEditEvents_OnCreateFeatureEventHandler(m_editEvents_OnCreateFeature);
                m_editEvents.OnChangeFeature += new IEditEvents_OnChangeFeatureEventHandler(m_editEvents_OnChangeFeature);
                m_editEvents.OnDeleteFeature += new IEditEvents_OnDeleteFeatureEventHandler(m_editEvents_OnDeleteFeature);
                m_editEvents.OnStartEditing += new IEditEvents_OnStartEditingEventHandler(m_editEvents_OnStartEditing);

                resourceManager = new ResourceManager("ESRI.ArcGIS.OSM.Editor.OSMFeatureInspectorStrings", this.GetType().Assembly);
                _osmUtility = new OSMClassExtension.OSMUtility();

                // retrtrieve osm editor specfic information
                m_editorConfigurationSettings = OSMGPFactory.ReadOSMEditorSettings();
            }
            catch { }
        }
        public void Shutdown()
        {
            // persist osm editor specific information like the osm base url, etc.
            OSMGPFactory.StoreOSMEditorSettings(m_editorConfigurationSettings);

            m_editEvents.OnDeleteFeature -= new IEditEvents_OnDeleteFeatureEventHandler(m_editEvents_OnDeleteFeature);
            m_editEvents.OnChangeFeature -= new IEditEvents_OnChangeFeatureEventHandler(m_editEvents_OnChangeFeature);
            m_editEvents.OnCreateFeature -= new IEditEvents_OnCreateFeatureEventHandler(m_editEvents_OnCreateFeature);
            m_editEvents.OnStartEditing -= new IEditEvents_OnStartEditingEventHandler(m_editEvents_OnStartEditing);

            m_editEvents2 = null;
            m_editEvents = null;
            m_editor3 = null;
            m_application = null;
        }