diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2020-04-11 21:49:09 +1000 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2020-04-12 12:46:21 +1000 |
| commit | 6d8b6f79b44b6a41a630aa3aad5a3c7f16701798 (patch) | |
| tree | b82ede9934cb7777a19e74a912c68481e76c21cd /src/WixToolset.Core/Compiler_UI.cs | |
| parent | df69d4172d3117d8b66ba51fa5ae7f4be538700d (diff) | |
| download | wix-6d8b6f79b44b6a41a630aa3aad5a3c7f16701798.tar.gz wix-6d8b6f79b44b6a41a630aa3aad5a3c7f16701798.tar.bz2 wix-6d8b6f79b44b6a41a630aa3aad5a3c7f16701798.zip | |
General cleanup.
Try not to send strings to specify the tuple or table.
Try to avoid using the Set method on tuples.
Always create new tuples and add them to the section in the same line.
Diffstat (limited to 'src/WixToolset.Core/Compiler_UI.cs')
| -rw-r--r-- | src/WixToolset.Core/Compiler_UI.cs | 153 |
1 files changed, 79 insertions, 74 deletions
diff --git a/src/WixToolset.Core/Compiler_UI.cs b/src/WixToolset.Core/Compiler_UI.cs index 60e89d12..3d554f12 100644 --- a/src/WixToolset.Core/Compiler_UI.cs +++ b/src/WixToolset.Core/Compiler_UI.cs | |||
| @@ -76,7 +76,7 @@ namespace WixToolset.Core | |||
| 76 | this.ParseDialogElement(child); | 76 | this.ParseDialogElement(child); |
| 77 | break; | 77 | break; |
| 78 | case "DialogRef": | 78 | case "DialogRef": |
| 79 | this.ParseSimpleRefElement(child, "Dialog"); | 79 | this.ParseSimpleRefElement(child, TupleDefinitions.Dialog); |
| 80 | break; | 80 | break; |
| 81 | case "EmbeddedUI": | 81 | case "EmbeddedUI": |
| 82 | if (0 < embeddedUICount) // there can be only one embedded UI | 82 | if (0 < embeddedUICount) // there can be only one embedded UI |
| @@ -132,10 +132,10 @@ namespace WixToolset.Core | |||
| 132 | this.ParsePropertyElement(child); | 132 | this.ParsePropertyElement(child); |
| 133 | break; | 133 | break; |
| 134 | case "PropertyRef": | 134 | case "PropertyRef": |
| 135 | this.ParseSimpleRefElement(child, "Property"); | 135 | this.ParseSimpleRefElement(child, TupleDefinitions.Property); |
| 136 | break; | 136 | break; |
| 137 | case "UIRef": | 137 | case "UIRef": |
| 138 | this.ParseSimpleRefElement(child, "WixUI"); | 138 | this.ParseSimpleRefElement(child, TupleDefinitions.WixUI); |
| 139 | break; | 139 | break; |
| 140 | 140 | ||
| 141 | default: | 141 | default: |
| @@ -151,8 +151,7 @@ namespace WixToolset.Core | |||
| 151 | 151 | ||
| 152 | if (null != id && !this.Core.EncounteredError) | 152 | if (null != id && !this.Core.EncounteredError) |
| 153 | { | 153 | { |
| 154 | var tuple = new WixUITuple(sourceLineNumbers, id); | 154 | this.Core.AddTuple(new WixUITuple(sourceLineNumbers, id)); |
| 155 | this.Core.AddTuple(tuple); | ||
| 156 | } | 155 | } |
| 157 | } | 156 | } |
| 158 | 157 | ||
| @@ -160,7 +159,7 @@ namespace WixToolset.Core | |||
| 160 | /// Parses a list item element. | 159 | /// Parses a list item element. |
| 161 | /// </summary> | 160 | /// </summary> |
| 162 | /// <param name="node">Element to parse.</param> | 161 | /// <param name="node">Element to parse.</param> |
| 163 | /// <param name="table">Table to add row to.</param> | 162 | /// <param name="tupleType">Type of tuple to create.</param> |
| 164 | /// <param name="property">Identifier of property referred to by list item.</param> | 163 | /// <param name="property">Identifier of property referred to by list item.</param> |
| 165 | /// <param name="order">Relative order of list items.</param> | 164 | /// <param name="order">Relative order of list items.</param> |
| 166 | private void ParseListItemElement(XElement node, TupleDefinitionType tupleType, string property, ref int order) | 165 | private void ParseListItemElement(XElement node, TupleDefinitionType tupleType, string property, ref int order) |
| @@ -180,7 +179,7 @@ namespace WixToolset.Core | |||
| 180 | if (TupleDefinitionType.ListView == tupleType) | 179 | if (TupleDefinitionType.ListView == tupleType) |
| 181 | { | 180 | { |
| 182 | icon = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 181 | icon = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
| 183 | this.Core.CreateSimpleReference(sourceLineNumbers, "Binary", icon); | 182 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.Binary, icon); |
| 184 | } | 183 | } |
| 185 | else | 184 | else |
| 186 | { | 185 | { |
| @@ -213,14 +212,42 @@ namespace WixToolset.Core | |||
| 213 | 212 | ||
| 214 | if (!this.Core.EncounteredError) | 213 | if (!this.Core.EncounteredError) |
| 215 | { | 214 | { |
| 216 | var tuple = this.Core.CreateTuple(sourceLineNumbers, tupleType); | 215 | switch (tupleType) |
| 217 | tuple.Set(0, property); | ||
| 218 | tuple.Set(1, ++order); | ||
| 219 | tuple.Set(2, value); | ||
| 220 | tuple.Set(3, text); | ||
| 221 | if (null != icon) | ||
| 222 | { | 216 | { |
| 223 | tuple.Set(4, icon); | 217 | case TupleDefinitionType.ComboBox: |
| 218 | this.Core.AddTuple(new ComboBoxTuple(sourceLineNumbers) | ||
| 219 | { | ||
| 220 | Property = property, | ||
| 221 | Order = ++order, | ||
| 222 | Value = value, | ||
| 223 | Text = text, | ||
| 224 | }); | ||
| 225 | break; | ||
| 226 | case TupleDefinitionType.ListBox: | ||
| 227 | this.Core.AddTuple(new ListBoxTuple(sourceLineNumbers) | ||
| 228 | { | ||
| 229 | Property = property, | ||
| 230 | Order = ++order, | ||
| 231 | Value = value, | ||
| 232 | Text = text, | ||
| 233 | }); | ||
| 234 | break; | ||
| 235 | case TupleDefinitionType.ListView: | ||
| 236 | var tuple = this.Core.AddTuple(new ListViewTuple(sourceLineNumbers) | ||
| 237 | { | ||
| 238 | Property = property, | ||
| 239 | Order = ++order, | ||
| 240 | Value = value, | ||
| 241 | Text = text, | ||
| 242 | }); | ||
| 243 | |||
| 244 | if (null != icon) | ||
| 245 | { | ||
| 246 | tuple.BinaryRef = icon; | ||
| 247 | } | ||
| 248 | break; | ||
| 249 | default: | ||
| 250 | throw new ArgumentOutOfRangeException(nameof(tupleType)); | ||
| 224 | } | 251 | } |
| 225 | } | 252 | } |
| 226 | } | 253 | } |
| @@ -257,7 +284,7 @@ namespace WixToolset.Core | |||
| 257 | this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttributes(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "Icon", "Text")); | 284 | this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttributes(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "Icon", "Text")); |
| 258 | } | 285 | } |
| 259 | text = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 286 | text = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
| 260 | this.Core.CreateSimpleReference(sourceLineNumbers, "Binary", text); | 287 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.Binary, text); |
| 261 | type = RadioButtonType.Bitmap; | 288 | type = RadioButtonType.Bitmap; |
| 262 | break; | 289 | break; |
| 263 | case "Height": | 290 | case "Height": |
| @@ -272,7 +299,7 @@ namespace WixToolset.Core | |||
| 272 | this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttributes(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "Bitmap", "Text")); | 299 | this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttributes(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "Bitmap", "Text")); |
| 273 | } | 300 | } |
| 274 | text = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 301 | text = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
| 275 | this.Core.CreateSimpleReference(sourceLineNumbers, "Binary", text); | 302 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.Binary, text); |
| 276 | type = RadioButtonType.Icon; | 303 | type = RadioButtonType.Icon; |
| 277 | break; | 304 | break; |
| 278 | case "Text": | 305 | case "Text": |
| @@ -338,21 +365,19 @@ namespace WixToolset.Core | |||
| 338 | 365 | ||
| 339 | if (!this.Core.EncounteredError) | 366 | if (!this.Core.EncounteredError) |
| 340 | { | 367 | { |
| 341 | var tuple = new RadioButtonTuple(sourceLineNumbers) | 368 | var tuple = this.Core.AddTuple(new RadioButtonTuple(sourceLineNumbers) |
| 342 | { | 369 | { |
| 343 | Property = property, | 370 | Property = property, |
| 344 | Order = ++order, | 371 | Order = ++order, |
| 345 | Value = value, | 372 | Value = value, |
| 346 | Text = text, | 373 | Text = text, |
| 347 | Help = (null != tooltip || null != help) ? String.Concat(tooltip, "|", help) : null | 374 | Help = (null != tooltip || null != help) ? String.Concat(tooltip, "|", help) : null |
| 348 | }; | 375 | }); |
| 349 | 376 | ||
| 350 | tuple.Set((int)RadioButtonTupleFields.X, x); | 377 | tuple.Set((int)RadioButtonTupleFields.X, x); |
| 351 | tuple.Set((int)RadioButtonTupleFields.Y, y); | 378 | tuple.Set((int)RadioButtonTupleFields.Y, y); |
| 352 | tuple.Set((int)RadioButtonTupleFields.Width, width); | 379 | tuple.Set((int)RadioButtonTupleFields.Width, width); |
| 353 | tuple.Set((int)RadioButtonTupleFields.Height, height); | 380 | tuple.Set((int)RadioButtonTupleFields.Height, height); |
| 354 | |||
| 355 | this.Core.AddTuple(tuple); | ||
| 356 | } | 381 | } |
| 357 | 382 | ||
| 358 | return type; | 383 | return type; |
| @@ -376,7 +401,7 @@ namespace WixToolset.Core | |||
| 376 | { | 401 | { |
| 377 | case "Id": | 402 | case "Id": |
| 378 | action = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 403 | action = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
| 379 | this.Core.CreateSimpleReference(sourceLineNumbers, "WixAction", "InstallExecuteSequence", action); | 404 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.WixAction, "InstallExecuteSequence", action); |
| 380 | break; | 405 | break; |
| 381 | default: | 406 | default: |
| 382 | this.Core.UnexpectedAttribute(node, attrib); | 407 | this.Core.UnexpectedAttribute(node, attrib); |
| @@ -439,7 +464,7 @@ namespace WixToolset.Core | |||
| 439 | break; | 464 | break; |
| 440 | case "Feature": | 465 | case "Feature": |
| 441 | feature = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 466 | feature = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
| 442 | this.Core.CreateSimpleReference(sourceLineNumbers, "Feature", feature); | 467 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.Feature, feature); |
| 443 | break; | 468 | break; |
| 444 | default: | 469 | default: |
| 445 | this.Core.UnexpectedAttribute(node, attrib); | 470 | this.Core.UnexpectedAttribute(node, attrib); |
| @@ -486,14 +511,12 @@ namespace WixToolset.Core | |||
| 486 | 511 | ||
| 487 | if (!this.Core.EncounteredError) | 512 | if (!this.Core.EncounteredError) |
| 488 | { | 513 | { |
| 489 | var tuple = new BillboardTuple(sourceLineNumbers, id) | 514 | this.Core.AddTuple(new BillboardTuple(sourceLineNumbers, id) |
| 490 | { | 515 | { |
| 491 | FeatureRef = feature, | 516 | FeatureRef = feature, |
| 492 | Action = action, | 517 | Action = action, |
| 493 | Ordering = order | 518 | Ordering = order |
| 494 | }; | 519 | }); |
| 495 | |||
| 496 | this.Core.AddTuple(tuple); | ||
| 497 | } | 520 | } |
| 498 | } | 521 | } |
| 499 | 522 | ||
| @@ -501,7 +524,7 @@ namespace WixToolset.Core | |||
| 501 | /// Parses a control group element. | 524 | /// Parses a control group element. |
| 502 | /// </summary> | 525 | /// </summary> |
| 503 | /// <param name="node">Element to parse.</param> | 526 | /// <param name="node">Element to parse.</param> |
| 504 | /// <param name="table">Table referred to by control group.</param> | 527 | /// <param name="tupleType">Tuple type referred to by control group.</param> |
| 505 | /// <param name="childTag">Expected child elements.</param> | 528 | /// <param name="childTag">Expected child elements.</param> |
| 506 | private void ParseControlGroupElement(XElement node, TupleDefinitionType tupleType, string childTag) | 529 | private void ParseControlGroupElement(XElement node, TupleDefinitionType tupleType, string childTag) |
| 507 | { | 530 | { |
| @@ -584,7 +607,7 @@ namespace WixToolset.Core | |||
| 584 | { | 607 | { |
| 585 | case "Property": | 608 | case "Property": |
| 586 | property = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 609 | property = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
| 587 | this.Core.CreateSimpleReference(sourceLineNumbers, "Property", property); | 610 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.Property, property); |
| 588 | break; | 611 | break; |
| 589 | default: | 612 | default: |
| 590 | this.Core.UnexpectedAttribute(node, attrib); | 613 | this.Core.UnexpectedAttribute(node, attrib); |
| @@ -677,14 +700,12 @@ namespace WixToolset.Core | |||
| 677 | 700 | ||
| 678 | if (!this.Core.EncounteredError) | 701 | if (!this.Core.EncounteredError) |
| 679 | { | 702 | { |
| 680 | var tuple = new ActionTextTuple(sourceLineNumbers) | 703 | this.Core.AddTuple(new ActionTextTuple(sourceLineNumbers) |
| 681 | { | 704 | { |
| 682 | Action = action, | 705 | Action = action, |
| 683 | Description = Common.GetInnerText(node), | 706 | Description = Common.GetInnerText(node), |
| 684 | Template = template | 707 | Template = template, |
| 685 | }; | 708 | }); |
| 686 | |||
| 687 | this.Core.AddTuple(tuple); | ||
| 688 | } | 709 | } |
| 689 | } | 710 | } |
| 690 | 711 | ||
| @@ -729,12 +750,10 @@ namespace WixToolset.Core | |||
| 729 | 750 | ||
| 730 | if (!this.Core.EncounteredError) | 751 | if (!this.Core.EncounteredError) |
| 731 | { | 752 | { |
| 732 | var tuple = new UITextTuple(sourceLineNumbers, id) | 753 | this.Core.AddTuple(new UITextTuple(sourceLineNumbers, id) |
| 733 | { | 754 | { |
| 734 | Text = text, | 755 | Text = text, |
| 735 | }; | 756 | }); |
| 736 | |||
| 737 | this.Core.AddTuple(tuple); | ||
| 738 | } | 757 | } |
| 739 | } | 758 | } |
| 740 | 759 | ||
| @@ -836,7 +855,7 @@ namespace WixToolset.Core | |||
| 836 | 855 | ||
| 837 | if (!this.Core.EncounteredError) | 856 | if (!this.Core.EncounteredError) |
| 838 | { | 857 | { |
| 839 | var tuple = new TextStyleTuple(sourceLineNumbers, id) | 858 | var tuple = this.Core.AddTuple(new TextStyleTuple(sourceLineNumbers, id) |
| 840 | { | 859 | { |
| 841 | FaceName = faceName, | 860 | FaceName = faceName, |
| 842 | Red = red, | 861 | Red = red, |
| @@ -846,11 +865,9 @@ namespace WixToolset.Core | |||
| 846 | Italic = italic, | 865 | Italic = italic, |
| 847 | Strike = strike, | 866 | Strike = strike, |
| 848 | Underline = underline, | 867 | Underline = underline, |
| 849 | }; | 868 | }); |
| 850 | 869 | ||
| 851 | tuple.Set((int)TextStyleTupleFields.Size, size); | 870 | tuple.Set((int)TextStyleTupleFields.Size, size); |
| 852 | |||
| 853 | this.Core.AddTuple(tuple); | ||
| 854 | } | 871 | } |
| 855 | } | 872 | } |
| 856 | 873 | ||
| @@ -994,7 +1011,7 @@ namespace WixToolset.Core | |||
| 994 | 1011 | ||
| 995 | if (!this.Core.EncounteredError) | 1012 | if (!this.Core.EncounteredError) |
| 996 | { | 1013 | { |
| 997 | var tuple = new DialogTuple(sourceLineNumbers, id) | 1014 | this.Core.AddTuple(new DialogTuple(sourceLineNumbers, id) |
| 998 | { | 1015 | { |
| 999 | HCentering = x, | 1016 | HCentering = x, |
| 1000 | VCentering = y, | 1017 | VCentering = y, |
| @@ -1015,9 +1032,7 @@ namespace WixToolset.Core | |||
| 1015 | FirstControlRef = firstControl, | 1032 | FirstControlRef = firstControl, |
| 1016 | DefaultControlRef = defaultControl, | 1033 | DefaultControlRef = defaultControl, |
| 1017 | CancelControlRef = cancelControl, | 1034 | CancelControlRef = cancelControl, |
| 1018 | }; | 1035 | }); |
| 1019 | |||
| 1020 | this.Core.AddTuple(tuple); | ||
| 1021 | } | 1036 | } |
| 1022 | } | 1037 | } |
| 1023 | 1038 | ||
| @@ -1083,7 +1098,7 @@ namespace WixToolset.Core | |||
| 1083 | notTabbable = true; | 1098 | notTabbable = true; |
| 1084 | disabled = true; | 1099 | disabled = true; |
| 1085 | 1100 | ||
| 1086 | this.Core.EnsureTable(sourceLineNumbers, "Billboard"); | 1101 | this.Core.EnsureTable(sourceLineNumbers, WindowsInstallerTableDefinitions.Billboard); |
| 1087 | break; | 1102 | break; |
| 1088 | case "Bitmap": | 1103 | case "Bitmap": |
| 1089 | specialAttributes = BitmapControlAttributes; | 1104 | specialAttributes = BitmapControlAttributes; |
| @@ -1449,17 +1464,15 @@ namespace WixToolset.Core | |||
| 1449 | } | 1464 | } |
| 1450 | else if (!String.IsNullOrEmpty(property)) | 1465 | else if (!String.IsNullOrEmpty(property)) |
| 1451 | { | 1466 | { |
| 1452 | var checkBoxTuple = new CheckBoxTuple(sourceLineNumbers) | 1467 | this.Core.AddTuple(new CheckBoxTuple(sourceLineNumbers) |
| 1453 | { | 1468 | { |
| 1454 | Property = property, | 1469 | Property = property, |
| 1455 | Value = checkboxValue | 1470 | Value = checkboxValue, |
| 1456 | }; | 1471 | }); |
| 1457 | |||
| 1458 | this.Core.AddTuple(checkBoxTuple); | ||
| 1459 | } | 1472 | } |
| 1460 | else | 1473 | else |
| 1461 | { | 1474 | { |
| 1462 | this.Core.CreateSimpleReference(sourceLineNumbers, "CheckBox", checkBoxPropertyRef); | 1475 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.CheckBox, checkBoxPropertyRef); |
| 1463 | } | 1476 | } |
| 1464 | } | 1477 | } |
| 1465 | 1478 | ||
| @@ -1467,7 +1480,7 @@ namespace WixToolset.Core | |||
| 1467 | 1480 | ||
| 1468 | if (TupleDefinitionType.BBControl == tupleType) | 1481 | if (TupleDefinitionType.BBControl == tupleType) |
| 1469 | { | 1482 | { |
| 1470 | var bbTuple = new BBControlTuple(sourceLineNumbers, id) | 1483 | var bbTuple = this.Core.AddTuple(new BBControlTuple(sourceLineNumbers, id) |
| 1471 | { | 1484 | { |
| 1472 | BillboardRef = dialog, | 1485 | BillboardRef = dialog, |
| 1473 | BBControl = controlId.Id, | 1486 | BBControl = controlId.Id, |
| @@ -1482,21 +1495,19 @@ namespace WixToolset.Core | |||
| 1482 | Sunken = sunken, | 1495 | Sunken = sunken, |
| 1483 | Visible = !hidden, | 1496 | Visible = !hidden, |
| 1484 | Text = text, | 1497 | Text = text, |
| 1485 | SourceFile = sourceFile | 1498 | SourceFile = sourceFile, |
| 1486 | }; | 1499 | }); |
| 1487 | 1500 | ||
| 1488 | bbTuple.Set((int)BBControlTupleFields.X, x); | 1501 | bbTuple.Set((int)BBControlTupleFields.X, x); |
| 1489 | bbTuple.Set((int)BBControlTupleFields.Y, y); | 1502 | bbTuple.Set((int)BBControlTupleFields.Y, y); |
| 1490 | bbTuple.Set((int)BBControlTupleFields.Width, width); | 1503 | bbTuple.Set((int)BBControlTupleFields.Width, width); |
| 1491 | bbTuple.Set((int)BBControlTupleFields.Height, height); | 1504 | bbTuple.Set((int)BBControlTupleFields.Height, height); |
| 1492 | 1505 | ||
| 1493 | this.Core.AddTuple(bbTuple); | ||
| 1494 | |||
| 1495 | tuple = bbTuple; | 1506 | tuple = bbTuple; |
| 1496 | } | 1507 | } |
| 1497 | else | 1508 | else |
| 1498 | { | 1509 | { |
| 1499 | var controlTuple = new ControlTuple(sourceLineNumbers, id) | 1510 | var controlTuple = this.Core.AddTuple(new ControlTuple(sourceLineNumbers, id) |
| 1500 | { | 1511 | { |
| 1501 | DialogRef = dialog, | 1512 | DialogRef = dialog, |
| 1502 | Control = controlId.Id, | 1513 | Control = controlId.Id, |
| @@ -1514,15 +1525,13 @@ namespace WixToolset.Core | |||
| 1514 | Text = text, | 1525 | Text = text, |
| 1515 | Help = (null == tooltip && null == help) ? null : String.Concat(tooltip, "|", help), // Separator is required, even if only one is non-null.}; | 1526 | Help = (null == tooltip && null == help) ? null : String.Concat(tooltip, "|", help), // Separator is required, even if only one is non-null.}; |
| 1516 | SourceFile = sourceFile | 1527 | SourceFile = sourceFile |
| 1517 | }; | 1528 | }); |
| 1518 | 1529 | ||
| 1519 | controlTuple.Set((int)BBControlTupleFields.X, x); | 1530 | controlTuple.Set((int)BBControlTupleFields.X, x); |
| 1520 | controlTuple.Set((int)BBControlTupleFields.Y, y); | 1531 | controlTuple.Set((int)BBControlTupleFields.Y, y); |
| 1521 | controlTuple.Set((int)BBControlTupleFields.Width, width); | 1532 | controlTuple.Set((int)BBControlTupleFields.Width, width); |
| 1522 | controlTuple.Set((int)BBControlTupleFields.Height, height); | 1533 | controlTuple.Set((int)BBControlTupleFields.Height, height); |
| 1523 | 1534 | ||
| 1524 | this.Core.AddTuple(controlTuple); | ||
| 1525 | |||
| 1526 | tuple = controlTuple; | 1535 | tuple = controlTuple; |
| 1527 | } | 1536 | } |
| 1528 | } | 1537 | } |
| @@ -1552,7 +1561,7 @@ namespace WixToolset.Core | |||
| 1552 | // add a reference if the identifier of the binary entry is known during compilation | 1561 | // add a reference if the identifier of the binary entry is known during compilation |
| 1553 | if (("Bitmap" == controlType || "Icon" == controlType) && Common.IsIdentifier(text)) | 1562 | if (("Bitmap" == controlType || "Icon" == controlType) && Common.IsIdentifier(text)) |
| 1554 | { | 1563 | { |
| 1555 | this.Core.CreateSimpleReference(sourceLineNumbers, "Binary", text); | 1564 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.Binary, text); |
| 1556 | } | 1565 | } |
| 1557 | } | 1566 | } |
| 1558 | 1567 | ||
| @@ -1593,7 +1602,7 @@ namespace WixToolset.Core | |||
| 1593 | this.Core.Write(ErrorMessages.IllegalAttributeWhenNested(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, node.Parent.Name.LocalName)); | 1602 | this.Core.Write(ErrorMessages.IllegalAttributeWhenNested(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, node.Parent.Name.LocalName)); |
| 1594 | } | 1603 | } |
| 1595 | dialog = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 1604 | dialog = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
| 1596 | this.Core.CreateSimpleReference(sourceLineNumbers, "Dialog", dialog); | 1605 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.Dialog, dialog); |
| 1597 | break; | 1606 | break; |
| 1598 | case "Event": | 1607 | case "Event": |
| 1599 | controlEvent = Compiler.UppercaseFirstChar(this.Core.GetAttributeValue(sourceLineNumbers, attrib)); | 1608 | controlEvent = Compiler.UppercaseFirstChar(this.Core.GetAttributeValue(sourceLineNumbers, attrib)); |
| @@ -1656,7 +1665,7 @@ namespace WixToolset.Core | |||
| 1656 | 1665 | ||
| 1657 | if (!this.Core.EncounteredError) | 1666 | if (!this.Core.EncounteredError) |
| 1658 | { | 1667 | { |
| 1659 | var tuple = new ControlEventTuple(sourceLineNumbers) | 1668 | this.Core.AddTuple(new ControlEventTuple(sourceLineNumbers) |
| 1660 | { | 1669 | { |
| 1661 | DialogRef = dialog, | 1670 | DialogRef = dialog, |
| 1662 | ControlRef = control, | 1671 | ControlRef = control, |
| @@ -1664,9 +1673,7 @@ namespace WixToolset.Core | |||
| 1664 | Argument = argument, | 1673 | Argument = argument, |
| 1665 | Condition = condition, | 1674 | Condition = condition, |
| 1666 | Ordering = order | 1675 | Ordering = order |
| 1667 | }; | 1676 | }); |
| 1668 | |||
| 1669 | this.Core.AddTuple(tuple); | ||
| 1670 | } | 1677 | } |
| 1671 | 1678 | ||
| 1672 | if ("DoAction" == controlEvent && null != argument) | 1679 | if ("DoAction" == controlEvent && null != argument) |
| @@ -1675,14 +1682,14 @@ namespace WixToolset.Core | |||
| 1675 | // to the custom action. | 1682 | // to the custom action. |
| 1676 | if (!WindowsInstallerStandard.IsStandardAction(argument) && !Common.ContainsProperty(argument)) | 1683 | if (!WindowsInstallerStandard.IsStandardAction(argument) && !Common.ContainsProperty(argument)) |
| 1677 | { | 1684 | { |
| 1678 | this.Core.CreateSimpleReference(sourceLineNumbers, "CustomAction", argument); | 1685 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.CustomAction, argument); |
| 1679 | } | 1686 | } |
| 1680 | } | 1687 | } |
| 1681 | 1688 | ||
| 1682 | // if we're referring to a dialog but not through a property, add it to the references | 1689 | // if we're referring to a dialog but not through a property, add it to the references |
| 1683 | if (("NewDialog" == controlEvent || "SpawnDialog" == controlEvent || "SpawnWaitDialog" == controlEvent || "SelectionBrowse" == controlEvent) && Common.IsIdentifier(argument)) | 1690 | if (("NewDialog" == controlEvent || "SpawnDialog" == controlEvent || "SpawnWaitDialog" == controlEvent || "SelectionBrowse" == controlEvent) && Common.IsIdentifier(argument)) |
| 1684 | { | 1691 | { |
| 1685 | this.Core.CreateSimpleReference(sourceLineNumbers, "Dialog", argument); | 1692 | this.Core.CreateSimpleReference(sourceLineNumbers, TupleDefinitions.Dialog, argument); |
| 1686 | } | 1693 | } |
| 1687 | } | 1694 | } |
| 1688 | 1695 | ||
| @@ -1725,15 +1732,13 @@ namespace WixToolset.Core | |||
| 1725 | 1732 | ||
| 1726 | if (!this.Core.EncounteredError) | 1733 | if (!this.Core.EncounteredError) |
| 1727 | { | 1734 | { |
| 1728 | var tuple = new EventMappingTuple(sourceLineNumbers) | 1735 | this.Core.AddTuple(new EventMappingTuple(sourceLineNumbers) |
| 1729 | { | 1736 | { |
| 1730 | DialogRef = dialog, | 1737 | DialogRef = dialog, |
| 1731 | ControlRef = control, | 1738 | ControlRef = control, |
| 1732 | Event = eventMapping, | 1739 | Event = eventMapping, |
| 1733 | Attribute = controlAttribute | 1740 | Attribute = controlAttribute, |
| 1734 | }; ; | 1741 | }); |
| 1735 | |||
| 1736 | this.Core.AddTuple(tuple); | ||
| 1737 | } | 1742 | } |
| 1738 | } | 1743 | } |
| 1739 | } | 1744 | } |
