Пример #1
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);
            }
        }