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/WixBundleContainerTuple.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/WixBundleContainerTuple.cs')
| -rw-r--r-- | src/WixToolset.Data/Tuples/WixBundleContainerTuple.cs | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/src/WixToolset.Data/Tuples/WixBundleContainerTuple.cs b/src/WixToolset.Data/Tuples/WixBundleContainerTuple.cs new file mode 100644 index 00000000..d06e029f --- /dev/null +++ b/src/WixToolset.Data/Tuples/WixBundleContainerTuple.cs | |||
| @@ -0,0 +1,111 @@ | |||
| 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 WixBundleContainer = new IntermediateTupleDefinition( | ||
| 10 | TupleDefinitionType.WixBundleContainer, | ||
| 11 | new[] | ||
| 12 | { | ||
| 13 | new IntermediateFieldDefinition(nameof(WixBundleContainerTupleFields.WixBundleContainer), IntermediateFieldType.String), | ||
| 14 | new IntermediateFieldDefinition(nameof(WixBundleContainerTupleFields.Name), IntermediateFieldType.String), | ||
| 15 | new IntermediateFieldDefinition(nameof(WixBundleContainerTupleFields.Type), IntermediateFieldType.Number), | ||
| 16 | new IntermediateFieldDefinition(nameof(WixBundleContainerTupleFields.DownloadUrl), IntermediateFieldType.String), | ||
| 17 | new IntermediateFieldDefinition(nameof(WixBundleContainerTupleFields.Size), IntermediateFieldType.Number), | ||
| 18 | new IntermediateFieldDefinition(nameof(WixBundleContainerTupleFields.Hash), IntermediateFieldType.String), | ||
| 19 | new IntermediateFieldDefinition(nameof(WixBundleContainerTupleFields.AttachedContainerIndex), IntermediateFieldType.Number), | ||
| 20 | new IntermediateFieldDefinition(nameof(WixBundleContainerTupleFields.WorkingPath), IntermediateFieldType.String), | ||
| 21 | }, | ||
| 22 | typeof(WixBundleContainerTuple)); | ||
| 23 | } | ||
| 24 | } | ||
| 25 | |||
| 26 | namespace WixToolset.Data.Tuples | ||
| 27 | { | ||
| 28 | using System; | ||
| 29 | |||
| 30 | public enum WixBundleContainerTupleFields | ||
| 31 | { | ||
| 32 | WixBundleContainer, | ||
| 33 | Name, | ||
| 34 | Type, | ||
| 35 | DownloadUrl, | ||
| 36 | Size, | ||
| 37 | Hash, | ||
| 38 | AttachedContainerIndex, | ||
| 39 | WorkingPath, | ||
| 40 | } | ||
| 41 | |||
| 42 | /// <summary> | ||
| 43 | /// Types of bundle packages. | ||
| 44 | /// </summary> | ||
| 45 | public enum ContainerType | ||
| 46 | { | ||
| 47 | Attached, | ||
| 48 | Detached, | ||
| 49 | } | ||
| 50 | |||
| 51 | public class WixBundleContainerTuple : IntermediateTuple | ||
| 52 | { | ||
| 53 | public WixBundleContainerTuple() : base(TupleDefinitions.WixBundleContainer, null, null) | ||
| 54 | { | ||
| 55 | } | ||
| 56 | |||
| 57 | public WixBundleContainerTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(TupleDefinitions.WixBundleContainer, sourceLineNumber, id) | ||
| 58 | { | ||
| 59 | } | ||
| 60 | |||
| 61 | public IntermediateField this[WixBundleContainerTupleFields index] => this.Fields[(int)index]; | ||
| 62 | |||
| 63 | public string WixBundleContainer | ||
| 64 | { | ||
| 65 | get => (string)this.Fields[(int)WixBundleContainerTupleFields.WixBundleContainer]?.Value; | ||
| 66 | set => this.Set((int)WixBundleContainerTupleFields.WixBundleContainer, value); | ||
| 67 | } | ||
| 68 | |||
| 69 | public string Name | ||
| 70 | { | ||
| 71 | get => (string)this.Fields[(int)WixBundleContainerTupleFields.Name]?.Value; | ||
| 72 | set => this.Set((int)WixBundleContainerTupleFields.Name, value); | ||
| 73 | } | ||
| 74 | |||
| 75 | public ContainerType Type | ||
| 76 | { | ||
| 77 | get => (ContainerType)Enum.Parse(typeof(ContainerType), (string)this.Fields[(int)WixBundleContainerTupleFields.Type]?.Value, true); | ||
| 78 | set => this.Set((int)WixBundleContainerTupleFields.Type, value.ToString()); | ||
| 79 | } | ||
| 80 | |||
| 81 | public string DownloadUrl | ||
| 82 | { | ||
| 83 | get => (string)this.Fields[(int)WixBundleContainerTupleFields.DownloadUrl]?.Value; | ||
| 84 | set => this.Set((int)WixBundleContainerTupleFields.DownloadUrl, value); | ||
| 85 | } | ||
| 86 | |||
| 87 | public int Size | ||
| 88 | { | ||
| 89 | get => (int)this.Fields[(int)WixBundleContainerTupleFields.Size]?.Value; | ||
| 90 | set => this.Set((int)WixBundleContainerTupleFields.Size, value); | ||
| 91 | } | ||
| 92 | |||
| 93 | public string Hash | ||
| 94 | { | ||
| 95 | get => (string)this.Fields[(int)WixBundleContainerTupleFields.Hash]?.Value; | ||
| 96 | set => this.Set((int)WixBundleContainerTupleFields.Hash, value); | ||
| 97 | } | ||
| 98 | |||
| 99 | public int AttachedContainerIndex | ||
| 100 | { | ||
| 101 | get => (int)this.Fields[(int)WixBundleContainerTupleFields.AttachedContainerIndex]?.Value; | ||
| 102 | set => this.Set((int)WixBundleContainerTupleFields.AttachedContainerIndex, value); | ||
| 103 | } | ||
| 104 | |||
| 105 | public string WorkingPath | ||
| 106 | { | ||
| 107 | get => (string)this.Fields[(int)WixBundleContainerTupleFields.WorkingPath]?.Value; | ||
| 108 | set => this.Set((int)WixBundleContainerTupleFields.WorkingPath, value); | ||
| 109 | } | ||
| 110 | } | ||
| 111 | } \ No newline at end of file | ||
