Example #1
0
        /// <summary>
        /// Decompile the ListView table.
        /// </summary>
        /// <param name="table">The table to decompile.</param>
        private void DecompileListViewTable(Table table)
        {
            Wix.ListView listView = null;
            SortedList listViewRows = new SortedList();

            // sort the list views by their property and order
            foreach (Row row in table.Rows)
            {
                listViewRows.Add(String.Concat("{0}|{1:0000000000}", row[0], row[1]), row);
            }

            foreach (Row row in listViewRows.Values)
            {
                if (null == listView || Convert.ToString(row[0]) != listView.Property)
                {
                    listView = new Wix.ListView();

                    listView.Property = Convert.ToString(row[0]);

                    this.core.UIElement.AddChild(listView);
                }

                Wix.ListItem listItem = new Wix.ListItem();

                listItem.Value = Convert.ToString(row[2]);

                if (null != row[3])
                {
                    listItem.Text = Convert.ToString(row[3]);
                }

                if (null != row[4])
                {
                    listItem.Icon = Convert.ToString(row[4]);
                }

                listView.AddChild(listItem);
            }
        }
Example #2
0
        /// <summary>
        /// Decompile the ComboBox table.
        /// </summary>
        /// <param name="table">The table to decompile.</param>
        private void DecompileComboBoxTable(Table table)
        {
            Wix.ComboBox comboBox = null;
            SortedList comboBoxRows = new SortedList();

            // sort the combo boxes by their property and order
            foreach (Row row in table.Rows)
            {
                comboBoxRows.Add(String.Concat("{0}|{1:0000000000}", row[0], row[1]), row);
            }

            foreach (Row row in comboBoxRows.Values)
            {
                if (null == comboBox || Convert.ToString(row[0]) != comboBox.Property)
                {
                    comboBox = new Wix.ComboBox();

                    comboBox.Property = Convert.ToString(row[0]);

                    this.core.UIElement.AddChild(comboBox);
                }

                Wix.ListItem listItem = new Wix.ListItem();

                listItem.Value = Convert.ToString(row[2]);

                if (null != row[3])
                {
                    listItem.Text = Convert.ToString(row[3]);
                }

                comboBox.AddChild(listItem);
            }
        }