public TableDefinitionCollection Execute()
        {
            var tableDefinitions  = new TableDefinitionCollection(WindowsInstallerTableDefinitions.All);
            var customColumnsById = this.Section.Symbols.OfType <WixCustomTableColumnSymbol>().ToDictionary(t => t.Id.Id);

            if (customColumnsById.Any())
            {
                foreach (var symbol in this.Section.Symbols.OfType <WixCustomTableSymbol>())
                {
                    var customTableDefinition = this.CreateCustomTable(symbol, customColumnsById);
                    tableDefinitions.Add(customTableDefinition);
                }
            }

            foreach (var backendExtension in this.BackendExtensions)
            {
                foreach (var tableDefinition in backendExtension.TableDefinitions)
                {
                    if (tableDefinitions.Contains(tableDefinition.Name))
                    {
                        this.Messaging.Write(ErrorMessages.DuplicateExtensionTable(backendExtension.GetType().Assembly.Location, tableDefinition.Name));
                    }

                    tableDefinitions.Add(tableDefinition);
                }
            }

            this.TableDefinitions = tableDefinitions;
            return(this.TableDefinitions);
        }
Ejemplo n.º 2
0
        public void AddSameTable()
        {
            TableDefinitionCollection list  = new TableDefinitionCollection(session.Configuration);
            TableDefinition           info1 = new TableDefinition(null, "TestTable", "dbo", session.Configuration);

            list.Add(info1);
            list.Add(info1);

            Assert.AreEqual(1, list.Count);
        }
Ejemplo n.º 3
0
        public void ExcludedTable()
        {
            TableDefinitionCollection list  = new TableDefinitionCollection(session.Configuration);
            TableDefinition           info1 = new TableDefinition(null, "TestExcludeTable", "dbo", session.Configuration);
            TableDefinition           info2 = new TableDefinition(null, "NonExcludeTable", "dbo", session.Configuration);

            list.Add(info1);
            list.Add(info2);

            Assert.AreEqual(1, list.Count);
            Assert.IsNull(list.FindTable("dbo", "TestExcludeTable"));
            Assert.IsNotNull(list.FindTable("dbo", "NonExcludeTable"));
        }
Ejemplo n.º 4
0
        public void FindInvalidTable()
        {
            TableDefinitionCollection list  = new TableDefinitionCollection(session.Configuration);
            TableDefinition           info1 = new TableDefinition(null, "TestTable1", "dbo", session.Configuration);
            TableDefinition           info2 = new TableDefinition(null, "TestTable2", "dbo", session.Configuration);
            TableDefinition           info3 = new TableDefinition(null, "TestTable3", "dbo", session.Configuration);
            TableDefinition           info4 = new TableDefinition(null, "TestTable4", "dbo", session.Configuration);
            TableDefinition           info5 = new TableDefinition(null, "TestTable5", "dbo", session.Configuration);

            list.Add(info1);
            list.Add(info2);
            list.Add(info3);
            list.Add(info4);
            list.Add(info5);

            Assert.AreEqual(5, list.Count);
            Assert.IsNull(list.FindTable("XSX", "TestTable3"));
            Assert.IsNull(list.FindTable("dbo", "XXXXTable2"));
            Assert.IsNull(list.FindTable("YyY", "TestTable1"));
            Assert.IsNull(list.FindTable("dbo", "TestTableBingo"));
            Assert.IsNull(list.FindTable("dba", "TestTableLooser"));
        }
Ejemplo n.º 5
0
        public void FindTable()
        {
            TableDefinitionCollection list  = new TableDefinitionCollection(session.Configuration);
            TableDefinition           info1 = new TableDefinition(null, "TestTable1", "dbo", session.Configuration);
            TableDefinition           info2 = new TableDefinition(null, "TestTable2", "dbo", session.Configuration);
            TableDefinition           info3 = new TableDefinition(null, "TestTable3", "dbo", session.Configuration);
            TableDefinition           info4 = new TableDefinition(null, "TestTable4", "dbo", session.Configuration);
            TableDefinition           info5 = new TableDefinition(null, "TestTable5", "dbo", session.Configuration);

            list.Add(info1);
            list.Add(info2);
            list.Add(info3);
            list.Add(info4);
            list.Add(info5);

            Assert.AreEqual(5, list.Count);
            Assert.AreEqual(info3, list.FindTable("dbo", "TestTable3"));
            Assert.AreEqual(info2, list.FindTable("dbo", "TestTable2"));
            Assert.AreEqual(info1, list.FindTable("dbo", "TestTable1"));
            Assert.AreEqual(info4, list.FindTable("dbo", "TestTable4"));
            Assert.AreEqual(info5, list.FindTable("dbo", "TestTable5"));
        }