Ejemplo n.º 1
0
        public override void ApplyChanges()
        {
            if (widget.IsChanged)
            {
                try {
                    //need to remove then add, in case we're replacing
                    RemoveUserSchemas();
                    AddUserSchemas();

                    // Update schema associations after we have added any new schemas to the schema manager.
                    foreach (string extension in widget.RemovedExtensions)
                    {
                        XmlEditorOptions.RemoveSchemaAssociation(extension);
                    }
                    foreach (XmlSchemaAssociation item in widget.GetChangedXmlSchemaAssociations())
                    {
                        XmlEditorOptions.SetSchemaAssociation(item);
                    }
                } catch (Exception ex) {
                    string msg = MonoDevelop.Core.GettextCatalog.GetString(
                        "Unhandled error saving schema changes.");
                    MonoDevelop.Core.LoggingService.LogError(msg, ex);
                    MonoDevelop.Ide.MessageService.ShowException(ex, msg);
                    return;
                }
            }
        }