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 { } }
/// <summary> /// Method to persist changes into the configuation file, if required. /// </summary> public void PersistOSMSettings() { if (m_isSettingsUpdateRequired) { OSMGPFactory.StoreOSMEditorSettings(m_editorConfigurationSettings); } }
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; }