Ejemplo n.º 1
0
        /// <summary>
        /// Occurs when this command is clicked
        /// </summary>
        public override void OnClick()
        {
            m_osmConflictEditorUI.FocusMap       = ((IMxDocument)m_application.Document).FocusMap;
            m_osmConflictEditorUI.defaultSymbols = m_application.Document as IDocumentDefaultSymbols;


            UID osmEditorExtensionCLSID = new UIDClass();

            osmEditorExtensionCLSID.Value = "{faa799f0-bdc7-4ca4-af0c-a8d591c22058}";
            OSMEditorExtension osmEditorExtension = m_application.FindExtensionByCLSID(osmEditorExtensionCLSID) as OSMEditorExtension;

            if (osmEditorExtension != null)
            {
                m_osmConflictEditorUI.OSMBaseURL = osmEditorExtension.OSMBaseURL;
            }

            UID editorUID = new UIDClass();

            editorUID.Value = "esriEditor.Editor";
            IEditor editor = m_application.FindExtensionByCLSID(editorUID) as IEditor;

            if (editor != null)
            {
                m_osmConflictEditorUI.Editor = editor;
            }

            IMouseCursor mouseCursor = new MouseCursorClass();

            mouseCursor.SetCursor(2);

            m_osmConflictEditorUI.ShowDialog(new WindowWrapper(new IntPtr(m_application.hWnd)));
        }
Ejemplo n.º 2
0
        void IComPropertyPage.Apply()
        {
            if (m_dirtyFlag)
            {
                if (m_editor != null)
                {
                    IExtensionManager extensionManager = m_editor as IExtensionManager;

                    //for (int index = 0; index < extensionManager.ExtensionCount; index++)
                    //{
                    //    System.Diagnostics.Debug.WriteLine(extensionManager.Extension[index].Name);
                    //}

                    UID osmEditorExtensionCLSID = new UIDClass();
                    osmEditorExtensionCLSID.Value = "{faa799f0-bdc7-4ca4-af0c-a8d591c22058}";
                    OSMEditorExtension osmEditorExtension = m_editor.Parent.FindExtensionByCLSID(osmEditorExtensionCLSID) as OSMEditorExtension;

                    if (osmEditorExtension != null)
                    {
                        osmEditorExtension.OSMBaseURL                      = m_osmbaseURL;
                        osmEditorExtension.OSMDomainsXmlFilePath           = txtOSMDomainFileLocation.Text;
                        osmEditorExtension.OSMFeaturePropertiesXmlFilePath = txtOSMFeaturePropertiesFileLocation.Text;

                        // makes the changes persisting throughout
                        osmEditorExtension.PersistOSMSettings();
                    }
                }

                SetPageDirty(false);
            }
        }
Ejemplo n.º 3
0
        int IComPropertyPage.Activate()
        {
            // get the OSM extension and retrieve the base url
            if (m_editor != null)
            {
                IExtensionManager extensionManager = m_editor as IExtensionManager;

                //for (int index = 0; index < extensionManager.ExtensionCount; index++)
                //{
                //    System.Diagnostics.Debug.WriteLine(extensionManager.Extension[index].Name);
                //}

                UID osmEditorExtensionCLSID = new UIDClass();
                osmEditorExtensionCLSID.Value = "{faa799f0-bdc7-4ca4-af0c-a8d591c22058}";
                OSMEditorExtension osmEditorExtension = m_editor.Parent.FindExtensionByCLSID(osmEditorExtensionCLSID) as OSMEditorExtension;

                if (osmEditorExtension != null)
                {
                    m_osmbaseURL                             = osmEditorExtension.OSMBaseURL;
                    txtOSMBaseURL.Text                       = m_osmbaseURL;
                    txtOSMDomainFileLocation.Text            = osmEditorExtension.OSMDomainsXmlFilePath;
                    txtOSMFeaturePropertiesFileLocation.Text = osmEditorExtension.OSMFeaturePropertiesXmlFilePath;
                }
            }

            txtOSMBaseURL.Focus();
            m_dirtyFlag = false;

            return(this.Handle.ToInt32());
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Supplies the page with the object(s) to be edited
        /// </summary>
        void IComPropertyPage.SetObjects(ESRI.ArcGIS.esriSystem.ISet objects)
        {
            if (objects == null || objects.Count == 0)
            {
                return;
            }

            //Prepare to hold on to editable objects
            if (m_objectBag == null)
            {
                m_objectBag = new Dictionary <string, object>();
            }
            else
            {
                m_objectBag.Clear();
            }

            objects.Reset();
            object testObject;

            while ((testObject = objects.Next()) != null)
            {
                if (testObject != null)
                {
                    m_editor = testObject as IEditor;
                    break;
                }
            }

            if (m_editor != null)
            {
                IExtensionManager extensionManager = m_editor as IExtensionManager;

                //for (int index = 0; index < extensionManager.ExtensionCount; index++)
                //{
                //    System.Diagnostics.Debug.WriteLine(extensionManager.Extension[index].Name);
                //}

                UID osmEditorExtensionCLSID = new UIDClass();
                osmEditorExtensionCLSID.Value = "{faa799f0-bdc7-4ca4-af0c-a8d591c22058}";
                OSMEditorExtension osmEditorExtension = m_editor.Parent.FindExtensionByCLSID(osmEditorExtensionCLSID) as OSMEditorExtension;

                if (osmEditorExtension != null)
                {
                    m_osmbaseURL = osmEditorExtension.OSMBaseURL;
                }
            }
        }