diff options
Diffstat (limited to 'src/WixToolset.Core/Compiler_UI.cs')
| -rw-r--r-- | src/WixToolset.Core/Compiler_UI.cs | 117 |
1 files changed, 71 insertions, 46 deletions
diff --git a/src/WixToolset.Core/Compiler_UI.cs b/src/WixToolset.Core/Compiler_UI.cs index fddb9061..24398895 100644 --- a/src/WixToolset.Core/Compiler_UI.cs +++ b/src/WixToolset.Core/Compiler_UI.cs | |||
| @@ -120,8 +120,10 @@ namespace WixToolset.Core | |||
| 120 | 120 | ||
| 121 | // the following are available indentically under the UI and Product elements for document organization use only | 121 | // the following are available indentically under the UI and Product elements for document organization use only |
| 122 | case "AdminUISequence": | 122 | case "AdminUISequence": |
| 123 | this.ParseSequenceElement(child, SequenceTable.AdminUISequence); | ||
| 124 | break; | ||
| 123 | case "InstallUISequence": | 125 | case "InstallUISequence": |
| 124 | this.ParseSequenceElement(child, child.Name.LocalName); | 126 | this.ParseSequenceElement(child, SequenceTable.InstallUISequence); |
| 125 | break; | 127 | break; |
| 126 | case "Binary": | 128 | case "Binary": |
| 127 | this.ParseBinaryElement(child); | 129 | this.ParseBinaryElement(child); |
| @@ -149,7 +151,8 @@ namespace WixToolset.Core | |||
| 149 | 151 | ||
| 150 | if (null != id && !this.Core.EncounteredError) | 152 | if (null != id && !this.Core.EncounteredError) |
| 151 | { | 153 | { |
| 152 | this.Core.CreateRow(sourceLineNumbers, TupleDefinitionType.WixUI, id); | 154 | var tuple = new WixUITuple(sourceLineNumbers, id); |
| 155 | this.Core.AddTuple(tuple); | ||
| 153 | } | 156 | } |
| 154 | } | 157 | } |
| 155 | 158 | ||
| @@ -160,7 +163,7 @@ namespace WixToolset.Core | |||
| 160 | /// <param name="table">Table to add row to.</param> | 163 | /// <param name="table">Table to add row to.</param> |
| 161 | /// <param name="property">Identifier of property referred to by list item.</param> | 164 | /// <param name="property">Identifier of property referred to by list item.</param> |
| 162 | /// <param name="order">Relative order of list items.</param> | 165 | /// <param name="order">Relative order of list items.</param> |
| 163 | private void ParseListItemElement(XElement node, TupleDefinitionType tableName, string property, ref int order) | 166 | private void ParseListItemElement(XElement node, TupleDefinitionType tupleType, string property, ref int order) |
| 164 | { | 167 | { |
| 165 | var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); | 168 | var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); |
| 166 | string icon = null; | 169 | string icon = null; |
| @@ -174,7 +177,7 @@ namespace WixToolset.Core | |||
| 174 | switch (attrib.Name.LocalName) | 177 | switch (attrib.Name.LocalName) |
| 175 | { | 178 | { |
| 176 | case "Icon": | 179 | case "Icon": |
| 177 | if (TupleDefinitionType.ListView == tableName) | 180 | if (TupleDefinitionType.ListView == tupleType) |
| 178 | { | 181 | { |
| 179 | icon = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 182 | icon = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
| 180 | this.Core.CreateSimpleReference(sourceLineNumbers, "Binary", icon); | 183 | this.Core.CreateSimpleReference(sourceLineNumbers, "Binary", icon); |
| @@ -210,14 +213,14 @@ namespace WixToolset.Core | |||
| 210 | 213 | ||
| 211 | if (!this.Core.EncounteredError) | 214 | if (!this.Core.EncounteredError) |
| 212 | { | 215 | { |
| 213 | var row = this.Core.CreateRow(sourceLineNumbers, tableName); | 216 | var tuple = this.Core.CreateTuple(sourceLineNumbers, tupleType); |
| 214 | row.Set(0, property); | 217 | tuple.Set(0, property); |
| 215 | row.Set(1, ++order); | 218 | tuple.Set(1, ++order); |
| 216 | row.Set(2, value); | 219 | tuple.Set(2, value); |
| 217 | row.Set(3, text); | 220 | tuple.Set(3, text); |
| 218 | if (null != icon) | 221 | if (null != icon) |
| 219 | { | 222 | { |
| 220 | row.Set(4, icon); | 223 | tuple.Set(4, icon); |
| 221 | } | 224 | } |
| 222 | } | 225 | } |
| 223 | } | 226 | } |
| @@ -335,19 +338,21 @@ namespace WixToolset.Core | |||
| 335 | 338 | ||
| 336 | if (!this.Core.EncounteredError) | 339 | if (!this.Core.EncounteredError) |
| 337 | { | 340 | { |
| 338 | var row = this.Core.CreateRow(sourceLineNumbers, TupleDefinitionType.RadioButton); | 341 | var tuple = new RadioButtonTuple(sourceLineNumbers) |
| 339 | row.Set(0, property); | ||
| 340 | row.Set(1, ++order); | ||
| 341 | row.Set(2, value); | ||
| 342 | row.Set(3, x); | ||
| 343 | row.Set(4, y); | ||
| 344 | row.Set(5, width); | ||
| 345 | row.Set(6, height); | ||
| 346 | row.Set(7, text); | ||
| 347 | if (null != tooltip || null != help) | ||
| 348 | { | 342 | { |
| 349 | row.Set(8, String.Concat(tooltip, "|", help)); | 343 | Property = property, |
| 350 | } | 344 | Order = ++order, |
| 345 | Value = value, | ||
| 346 | Text = text, | ||
| 347 | Help = (null != tooltip || null != help) ? String.Concat(tooltip, "|", help) : null | ||
| 348 | }; | ||
| 349 | |||
| 350 | tuple.Set((int)RadioButtonTupleFields.X, x); | ||
| 351 | tuple.Set((int)RadioButtonTupleFields.Y, y); | ||
| 352 | tuple.Set((int)RadioButtonTupleFields.Width, width); | ||
| 353 | tuple.Set((int)RadioButtonTupleFields.Height, height); | ||
| 354 | |||
| 355 | this.Core.AddTuple(tuple); | ||
| 351 | } | 356 | } |
| 352 | 357 | ||
| 353 | return type; | 358 | return type; |
| @@ -481,10 +486,14 @@ namespace WixToolset.Core | |||
| 481 | 486 | ||
| 482 | if (!this.Core.EncounteredError) | 487 | if (!this.Core.EncounteredError) |
| 483 | { | 488 | { |
| 484 | var row = this.Core.CreateRow(sourceLineNumbers, TupleDefinitionType.Billboard, id); | 489 | var tuple = new BillboardTuple(sourceLineNumbers, id) |
| 485 | row.Set(1, feature); | 490 | { |
| 486 | row.Set(2, action); | 491 | Feature_ = feature, |
| 487 | row.Set(3, order); | 492 | Action = action, |
| 493 | Ordering = order | ||
| 494 | }; | ||
| 495 | |||
| 496 | this.Core.AddTuple(tuple); | ||
| 488 | } | 497 | } |
| 489 | } | 498 | } |
| 490 | 499 | ||
| @@ -494,7 +503,7 @@ namespace WixToolset.Core | |||
| 494 | /// <param name="node">Element to parse.</param> | 503 | /// <param name="node">Element to parse.</param> |
| 495 | /// <param name="table">Table referred to by control group.</param> | 504 | /// <param name="table">Table referred to by control group.</param> |
| 496 | /// <param name="childTag">Expected child elements.</param> | 505 | /// <param name="childTag">Expected child elements.</param> |
| 497 | private void ParseControlGroupElement(XElement node, TupleDefinitionType tableName, string childTag) | 506 | private void ParseControlGroupElement(XElement node, TupleDefinitionType tupleType, string childTag) |
| 498 | { | 507 | { |
| 499 | var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); | 508 | var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); |
| 500 | var order = 0; | 509 | var order = 0; |
| @@ -537,7 +546,7 @@ namespace WixToolset.Core | |||
| 537 | switch (child.Name.LocalName) | 546 | switch (child.Name.LocalName) |
| 538 | { | 547 | { |
| 539 | case "ListItem": | 548 | case "ListItem": |
| 540 | this.ParseListItemElement(child, tableName, property, ref order); | 549 | this.ParseListItemElement(child, tupleType, property, ref order); |
| 541 | break; | 550 | break; |
| 542 | case "Property": | 551 | case "Property": |
| 543 | this.ParsePropertyElement(child); | 552 | this.ParsePropertyElement(child); |
| @@ -668,10 +677,14 @@ namespace WixToolset.Core | |||
| 668 | 677 | ||
| 669 | if (!this.Core.EncounteredError) | 678 | if (!this.Core.EncounteredError) |
| 670 | { | 679 | { |
| 671 | var row = this.Core.CreateRow(sourceLineNumbers, TupleDefinitionType.ActionText); | 680 | var tuple = new ActionTextTuple(sourceLineNumbers) |
| 672 | row.Set(0, action); | 681 | { |
| 673 | row.Set(1, Common.GetInnerText(node)); | 682 | Action = action, |
| 674 | row.Set(2, template); | 683 | Description = Common.GetInnerText(node), |
| 684 | Template = template | ||
| 685 | }; | ||
| 686 | |||
| 687 | this.Core.AddTuple(tuple); | ||
| 675 | } | 688 | } |
| 676 | } | 689 | } |
| 677 | 690 | ||
| @@ -716,8 +729,12 @@ namespace WixToolset.Core | |||
| 716 | 729 | ||
| 717 | if (!this.Core.EncounteredError) | 730 | if (!this.Core.EncounteredError) |
| 718 | { | 731 | { |
| 719 | var row = this.Core.CreateRow(sourceLineNumbers, TupleDefinitionType.UIText, id); | 732 | var tuple = new UITextTuple(sourceLineNumbers, id) |
| 720 | row.Set(1, text); | 733 | { |
| 734 | Text = text, | ||
| 735 | }; | ||
| 736 | |||
| 737 | this.Core.AddTuple(tuple); | ||
| 721 | } | 738 | } |
| 722 | } | 739 | } |
| 723 | 740 | ||
| @@ -1654,13 +1671,17 @@ namespace WixToolset.Core | |||
| 1654 | 1671 | ||
| 1655 | if (!this.Core.EncounteredError) | 1672 | if (!this.Core.EncounteredError) |
| 1656 | { | 1673 | { |
| 1657 | var row = this.Core.CreateRow(sourceLineNumbers, TupleDefinitionType.ControlEvent); | 1674 | var tuple = new ControlEventTuple(sourceLineNumbers) |
| 1658 | row.Set(0, dialog); | 1675 | { |
| 1659 | row.Set(1, control); | 1676 | Dialog_ = dialog, |
| 1660 | row.Set(2, (null != controlEvent ? controlEvent : property)); | 1677 | Control_ = control, |
| 1661 | row.Set(3, argument); | 1678 | Event = controlEvent ?? property, |
| 1662 | row.Set(4, condition); | 1679 | Argument = argument, |
| 1663 | row.Set(5, order); | 1680 | Condition = condition, |
| 1681 | Ordering = order | ||
| 1682 | }; | ||
| 1683 | |||
| 1684 | this.Core.AddTuple(tuple); | ||
| 1664 | } | 1685 | } |
| 1665 | 1686 | ||
| 1666 | if ("DoAction" == controlEvent && null != argument) | 1687 | if ("DoAction" == controlEvent && null != argument) |
| @@ -1719,11 +1740,15 @@ namespace WixToolset.Core | |||
| 1719 | 1740 | ||
| 1720 | if (!this.Core.EncounteredError) | 1741 | if (!this.Core.EncounteredError) |
| 1721 | { | 1742 | { |
| 1722 | var row = this.Core.CreateRow(sourceLineNumbers, TupleDefinitionType.EventMapping); | 1743 | var tuple = new EventMappingTuple(sourceLineNumbers) |
| 1723 | row.Set(0, dialog); | 1744 | { |
| 1724 | row.Set(1, control); | 1745 | Dialog_ = dialog, |
| 1725 | row.Set(2, eventMapping); | 1746 | Control_ = control, |
| 1726 | row.Set(3, controlAttribute); | 1747 | Event = eventMapping, |
| 1748 | Attribute = controlAttribute | ||
| 1749 | }; ; | ||
| 1750 | |||
| 1751 | this.Core.AddTuple(tuple); | ||
| 1727 | } | 1752 | } |
| 1728 | } | 1753 | } |
| 1729 | } | 1754 | } |
