diff options
| author | Rob Mensching <rob@firegiant.com> | 2017-11-01 10:56:09 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2017-11-01 10:56:09 -0700 |
| commit | 69b15d96cebdbb7201b1849b4f62786633d70b8d (patch) | |
| tree | 4b65de8679e4b4ab81b69edcccbac1ae9f55a16d /src/WixToolset.Data/Tuples/WixComplexReferenceTuple.cs | |
| parent | a8656a87887d6cb2c54f4bbeacee37f7074f1032 (diff) | |
| download | wix-69b15d96cebdbb7201b1849b4f62786633d70b8d.tar.gz wix-69b15d96cebdbb7201b1849b4f62786633d70b8d.tar.bz2 wix-69b15d96cebdbb7201b1849b4f62786633d70b8d.zip | |
Introduce WiX Intermediate Representation
Diffstat (limited to 'src/WixToolset.Data/Tuples/WixComplexReferenceTuple.cs')
| -rw-r--r-- | src/WixToolset.Data/Tuples/WixComplexReferenceTuple.cs | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/src/WixToolset.Data/Tuples/WixComplexReferenceTuple.cs b/src/WixToolset.Data/Tuples/WixComplexReferenceTuple.cs new file mode 100644 index 00000000..46de9aa9 --- /dev/null +++ b/src/WixToolset.Data/Tuples/WixComplexReferenceTuple.cs | |||
| @@ -0,0 +1,86 @@ | |||
| 1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
| 2 | |||
| 3 | namespace WixToolset.Data | ||
| 4 | { | ||
| 5 | using WixToolset.Data.Tuples; | ||
| 6 | |||
| 7 | public static partial class TupleDefinitions | ||
| 8 | { | ||
| 9 | public static readonly IntermediateTupleDefinition WixComplexReference = new IntermediateTupleDefinition( | ||
| 10 | TupleDefinitionType.WixComplexReference, | ||
| 11 | new[] | ||
| 12 | { | ||
| 13 | new IntermediateFieldDefinition(nameof(WixComplexReferenceTupleFields.Parent), IntermediateFieldType.String), | ||
| 14 | new IntermediateFieldDefinition(nameof(WixComplexReferenceTupleFields.ParentAttributes), IntermediateFieldType.String), | ||
| 15 | new IntermediateFieldDefinition(nameof(WixComplexReferenceTupleFields.ParentLanguage), IntermediateFieldType.String), | ||
| 16 | new IntermediateFieldDefinition(nameof(WixComplexReferenceTupleFields.Child), IntermediateFieldType.String), | ||
| 17 | new IntermediateFieldDefinition(nameof(WixComplexReferenceTupleFields.ChildAttributes), IntermediateFieldType.String), | ||
| 18 | new IntermediateFieldDefinition(nameof(WixComplexReferenceTupleFields.Attributes), IntermediateFieldType.Bool), | ||
| 19 | }, | ||
| 20 | typeof(WixComplexReferenceTuple)); | ||
| 21 | } | ||
| 22 | } | ||
| 23 | |||
| 24 | namespace WixToolset.Data.Tuples | ||
| 25 | { | ||
| 26 | using System; | ||
| 27 | |||
| 28 | public enum WixComplexReferenceTupleFields | ||
| 29 | { | ||
| 30 | Parent, | ||
| 31 | ParentAttributes, | ||
| 32 | ParentLanguage, | ||
| 33 | Child, | ||
| 34 | ChildAttributes, | ||
| 35 | Attributes, | ||
| 36 | } | ||
| 37 | |||
| 38 | public class WixComplexReferenceTuple : IntermediateTuple | ||
| 39 | { | ||
| 40 | public WixComplexReferenceTuple() : base(TupleDefinitions.WixComplexReference, null, null) | ||
| 41 | { | ||
| 42 | } | ||
| 43 | |||
| 44 | public WixComplexReferenceTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(TupleDefinitions.WixComplexReference, sourceLineNumber, id) | ||
| 45 | { | ||
| 46 | } | ||
| 47 | |||
| 48 | public IntermediateField this[WixComplexReferenceTupleFields index] => this.Fields[(int)index]; | ||
| 49 | |||
| 50 | public string Parent | ||
| 51 | { | ||
| 52 | get => (string)this.Fields[(int)WixComplexReferenceTupleFields.Parent]?.Value; | ||
| 53 | set => this.Set((int)WixComplexReferenceTupleFields.Parent, value); | ||
| 54 | } | ||
| 55 | |||
| 56 | public ComplexReferenceParentType ParentType | ||
| 57 | { | ||
| 58 | get => (ComplexReferenceParentType)Enum.Parse(typeof(ComplexReferenceParentType), (string)this.Fields[(int)WixComplexReferenceTupleFields.ParentAttributes]?.Value, true); | ||
| 59 | set => this.Set((int)WixComplexReferenceTupleFields.ParentAttributes, value.ToString()); | ||
| 60 | } | ||
| 61 | |||
| 62 | public string ParentLanguage | ||
| 63 | { | ||
| 64 | get => (string)this.Fields[(int)WixComplexReferenceTupleFields.ParentLanguage]?.Value; | ||
| 65 | set => this.Set((int)WixComplexReferenceTupleFields.ParentLanguage, value); | ||
| 66 | } | ||
| 67 | |||
| 68 | public string Child | ||
| 69 | { | ||
| 70 | get => (string)this.Fields[(int)WixComplexReferenceTupleFields.Child]?.Value; | ||
| 71 | set => this.Set((int)WixComplexReferenceTupleFields.Child, value); | ||
| 72 | } | ||
| 73 | |||
| 74 | public ComplexReferenceChildType ChildType | ||
| 75 | { | ||
| 76 | get => (ComplexReferenceChildType)Enum.Parse(typeof(ComplexReferenceChildType), (string)this.Fields[(int)WixComplexReferenceTupleFields.ChildAttributes]?.Value, true); | ||
| 77 | set => this.Set((int)WixComplexReferenceTupleFields.ChildAttributes, value.ToString()); | ||
| 78 | } | ||
| 79 | |||
| 80 | public bool IsPrimary | ||
| 81 | { | ||
| 82 | get => (bool)this.Fields[(int)WixComplexReferenceTupleFields.Attributes]?.Value; | ||
| 83 | set => this.Set((int)WixComplexReferenceTupleFields.Attributes, value); | ||
| 84 | } | ||
| 85 | } | ||
| 86 | } \ No newline at end of file | ||
