aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Core/Compiler.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/WixToolset.Core/Compiler.cs')
-rw-r--r--src/WixToolset.Core/Compiler.cs67
1 files changed, 67 insertions, 0 deletions
diff --git a/src/WixToolset.Core/Compiler.cs b/src/WixToolset.Core/Compiler.cs
index 020e35fe..3fa06f9c 100644
--- a/src/WixToolset.Core/Compiler.cs
+++ b/src/WixToolset.Core/Compiler.cs
@@ -3612,6 +3612,7 @@ namespace WixToolset.Core
3612 string tableId = null; 3612 string tableId = null;
3613 var unreal = false; 3613 var unreal = false;
3614 var columns = new List<WixCustomTableColumnSymbol>(); 3614 var columns = new List<WixCustomTableColumnSymbol>();
3615 var foundColumns = false;
3615 3616
3616 foreach (var attrib in node.Attributes()) 3617 foreach (var attrib in node.Attributes())
3617 { 3618 {
@@ -3653,6 +3654,8 @@ namespace WixToolset.Core
3653 switch (child.Name.LocalName) 3654 switch (child.Name.LocalName)
3654 { 3655 {
3655 case "Column": 3656 case "Column":
3657 foundColumns = true;
3658
3656 var column = this.ParseColumnElement(child, childSourceLineNumbers, tableId); 3659 var column = this.ParseColumnElement(child, childSourceLineNumbers, tableId);
3657 if (column != null) 3660 if (column != null)
3658 { 3661 {
@@ -3690,6 +3693,67 @@ namespace WixToolset.Core
3690 Unreal = unreal, 3693 Unreal = unreal,
3691 }); 3694 });
3692 } 3695 }
3696 else if (!foundColumns)
3697 {
3698 this.Core.Write(ErrorMessages.ExpectedElement(sourceLineNumbers, node.Name.LocalName, "Column"));
3699 }
3700 }
3701 }
3702
3703 /// <summary>
3704 /// Parses a CustomTableRef element.
3705 /// </summary>
3706 /// <param name="node">Element to parse.</param>
3707 private void ParseCustomTableRefElement(XElement node)
3708 {
3709 var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node);
3710 string tableId = null;
3711
3712 foreach (var attrib in node.Attributes())
3713 {
3714 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || CompilerCore.WixNamespace == attrib.Name.Namespace)
3715 {
3716 switch (attrib.Name.LocalName)
3717 {
3718 case "Id":
3719 tableId = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
3720 this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.WixCustomTable, tableId);
3721 break;
3722 default:
3723 this.Core.UnexpectedAttribute(node, attrib);
3724 break;
3725 }
3726 }
3727 else
3728 {
3729 this.Core.ParseExtensionAttribute(node, attrib);
3730 }
3731 }
3732
3733 if (null == tableId)
3734 {
3735 this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id"));
3736 }
3737
3738 foreach (var child in node.Elements())
3739 {
3740 if (CompilerCore.WixNamespace == child.Name.Namespace)
3741 {
3742 var childSourceLineNumbers = Preprocessor.GetSourceLineNumbers(child);
3743 switch (child.Name.LocalName)
3744 {
3745 case "Row":
3746 this.ParseRowElement(child, childSourceLineNumbers, tableId);
3747 break;
3748 default:
3749 this.Core.UnexpectedElement(node, child);
3750 break;
3751 }
3752 }
3753 else
3754 {
3755 this.Core.ParseExtensionElement(node, child);
3756 }
3693 } 3757 }
3694 } 3758 }
3695 3759
@@ -6155,6 +6219,9 @@ namespace WixToolset.Core
6155 case "CustomTable": 6219 case "CustomTable":
6156 this.ParseCustomTableElement(child); 6220 this.ParseCustomTableElement(child);
6157 break; 6221 break;
6222 case "CustomTableRef":
6223 this.ParseCustomTableRefElement(child);
6224 break;
6158 case "Directory": 6225 case "Directory":
6159 this.ParseDirectoryElement(child, null, CompilerConstants.IntegerNotSet, String.Empty); 6226 this.ParseDirectoryElement(child, null, CompilerConstants.IntegerNotSet, String.Empty);
6160 break; 6227 break;