Exemplo n.º 1
0
        /// <summary>
        /// Removes the schema with the specified namespace from the
        /// user schemas folder and removes the completion data.
        /// </summary>
        public static void RemoveUserSchema(string namespaceUri)
        {
            XmlSchemaCompletionData schemaData = UserSchemas [namespaceUri];

            if (schemaData != null)
            {
                if (File.Exists(schemaData.FileName))
                {
                    File.Delete(schemaData.FileName);
                }
                UserSchemas.Remove(schemaData);
                OnUserSchemaRemoved();
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// The CreateClasses
 /// </summary>
 private void CreateClasses()
 {
     this.documents      = new Documents(this.client);
     this.authentication = new Authentication(this.client);
     this.applications   = new Applications(this.client);
     this.blobs          = new Blobs(this.client);
     this.collections    = new Collections(client);
     this.repos          = new Repositories(client);
     this.schemas        = new Schemas(client);
     this.users          = new Users(client);
     this.userSchemas    = new UserSchemas(client);
     this.groups         = new Groups(client);
     this.permissions    = new Permissions(client);
 }
Exemplo n.º 3
0
        /// <summary>
        /// Adds the schema to the user schemas folder and makes the
        /// schema available to the xml editor.
        /// </summary>
        public static void AddUserSchema(XmlSchemaCompletionData schemaData)
        {
            if (UserSchemas [schemaData.NamespaceUri] == null)
            {
                if (!Directory.Exists(UserSchemaFolder))
                {
                    Directory.CreateDirectory(UserSchemaFolder);
                }

                string fileName            = Path.GetFileName(schemaData.FileName);
                string destinationFileName = Path.Combine(UserSchemaFolder, fileName);
                File.Copy(schemaData.FileName, destinationFileName);
                schemaData.FileName = destinationFileName;
                UserSchemas.Add(schemaData);
                OnUserSchemaAdded();
            }
            else
            {
                LoggingService.LogWarning("XmlSchemaManager cannot register two schemas with the same namespace '{0}'.", schemaData.NamespaceUri);
            }
        }