Пример #1
0
        /// <summary>
        /// Adds an extension to the librarian.
        /// </summary>
        /// <param name="extension">Schema extension to add to librarian.</param>
        public void AddExtension(SchemaExtension extension)
        {
            extension.Messages = this.extensionMessages;

            // check if this extension is addding a schema namespace that already exists
            if (this.extensions.Contains(extension.Schema.TargetNamespace))
            {
                throw new WixExtensionNamespaceConflictException(extension, (SchemaExtension)this.extensions[extension.Schema.TargetNamespace]);
            }

            // check if the extension is adding a table that already exists
            foreach (TableDefinition tableDefinition in extension.TableDefinitions)
            {
                if (this.tableDefinitions.Contains(tableDefinition.Name))
                {
                    throw new WixExtensionTableDefinitionConflictException(extension, tableDefinition);
                }
            }

            // add the extension and its table definitions to the librarian
            this.extensions.Add(extension.Schema.TargetNamespace, extension);
            foreach (TableDefinition tableDefinition in extension.TableDefinitions)
            {
                this.tableDefinitions.Add(tableDefinition);
            }
        }
Пример #2
0
        /// <summary>
        /// Adds an extension to the librarian.
        /// </summary>
        /// <param name="extension">Schema extension to add to librarian.</param>
        public void AddExtension(SchemaExtension extension)
        {
            extension.Messages = this.extensionMessages;

            // check if this extension is addding a schema namespace that already exists
            if (this.extensions.Contains(extension.Schema.TargetNamespace))
            {
                throw new WixExtensionNamespaceConflictException(extension, (SchemaExtension)this.extensions[extension.Schema.TargetNamespace]);
            }

            // check if the extension is adding a table that already exists
            foreach (TableDefinition tableDefinition in extension.TableDefinitions)
            {
                if (this.tableDefinitions.Contains(tableDefinition.Name))
                {
                    throw new WixExtensionTableDefinitionConflictException(extension, tableDefinition);
                }
            }

            // add the extension and its table definitions to the librarian
            this.extensions.Add(extension.Schema.TargetNamespace, extension);
            foreach (TableDefinition tableDefinition in extension.TableDefinitions)
            {
                this.tableDefinitions.Add(tableDefinition);
            }
        }
 /// <summary>
 /// Instantiate a new WixExtensionTableDefinitionConflictException.
 /// </summary>
 /// <param name="extension">Extension with conflict.</param>
 /// <param name="tableDefinition">Table definition conflicting</param>
 public WixExtensionTableDefinitionConflictException(SchemaExtension extension, TableDefinition tableDefinition) :
     base(null, ExceptionType)
 {
     this.extension       = extension;
     this.tableDefinition = tableDefinition;
 }
Пример #4
0
 /// <summary>
 /// Instantiate a new WixExtensionNamespaceConflictException.
 /// </summary>
 /// <param name="extension">Extension with the conflict.</param>
 /// <param name="existingExtension">Existing extension with the same namespace</param>
 public WixExtensionNamespaceConflictException(SchemaExtension extension, SchemaExtension existingExtension) :
     base(null, ExceptionType)
 {
     this.extension         = extension;
     this.existingExtension = existingExtension;
 }
 /// <summary>
 /// Instantiate a new WixExtensionNamespaceConflictException.
 /// </summary>
 /// <param name="extension">Extension with the conflict.</param>
 /// <param name="existingExtension">Existing extension with the same namespace</param>
 public WixExtensionNamespaceConflictException(SchemaExtension extension, SchemaExtension existingExtension)
     : base(null, ExceptionType)
 {
     this.extension = extension;
     this.existingExtension = existingExtension;
 }
 /// <summary>
 /// Instantiate a new WixExtensionTableDefinitionConflictException.
 /// </summary>
 /// <param name="extension">Extension with conflict.</param>
 /// <param name="tableDefinition">Table definition conflicting</param>
 public WixExtensionTableDefinitionConflictException(SchemaExtension extension, TableDefinition tableDefinition)
     : base(null, ExceptionType)
 {
     this.extension = extension;
     this.tableDefinition = tableDefinition;
 }