diff options
| author | Rob Mensching <rob@firegiant.com> | 2019-05-08 13:35:21 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2019-05-08 13:44:59 -0700 |
| commit | ef6485ac4a03333701d343c1e3a52d25805c58f1 (patch) | |
| tree | 3093b1410e651a90c3776b42090bb4e62e98c514 /src/WixToolset.Data/Tuples/EnvironmentTuple.cs | |
| parent | 6e7a3274a1710a734e5369d0a1703b9c9ac9345b (diff) | |
| download | wix-ef6485ac4a03333701d343c1e3a52d25805c58f1.tar.gz wix-ef6485ac4a03333701d343c1e3a52d25805c58f1.tar.bz2 wix-ef6485ac4a03333701d343c1e3a52d25805c58f1.zip | |
Add additional strongly typed tuples
Diffstat (limited to 'src/WixToolset.Data/Tuples/EnvironmentTuple.cs')
| -rw-r--r-- | src/WixToolset.Data/Tuples/EnvironmentTuple.cs | 62 |
1 files changed, 54 insertions, 8 deletions
diff --git a/src/WixToolset.Data/Tuples/EnvironmentTuple.cs b/src/WixToolset.Data/Tuples/EnvironmentTuple.cs index 9ee05a19..7e3443d8 100644 --- a/src/WixToolset.Data/Tuples/EnvironmentTuple.cs +++ b/src/WixToolset.Data/Tuples/EnvironmentTuple.cs | |||
| @@ -10,9 +10,13 @@ namespace WixToolset.Data | |||
| 10 | TupleDefinitionType.Environment, | 10 | TupleDefinitionType.Environment, |
| 11 | new[] | 11 | new[] |
| 12 | { | 12 | { |
| 13 | new IntermediateFieldDefinition(nameof(EnvironmentTupleFields.Environment), IntermediateFieldType.String), | ||
| 14 | new IntermediateFieldDefinition(nameof(EnvironmentTupleFields.Name), IntermediateFieldType.String), | 13 | new IntermediateFieldDefinition(nameof(EnvironmentTupleFields.Name), IntermediateFieldType.String), |
| 15 | new IntermediateFieldDefinition(nameof(EnvironmentTupleFields.Value), IntermediateFieldType.String), | 14 | new IntermediateFieldDefinition(nameof(EnvironmentTupleFields.Value), IntermediateFieldType.String), |
| 15 | new IntermediateFieldDefinition(nameof(EnvironmentTupleFields.Separator), IntermediateFieldType.String), | ||
| 16 | new IntermediateFieldDefinition(nameof(EnvironmentTupleFields.Action), IntermediateFieldType.Number), | ||
| 17 | new IntermediateFieldDefinition(nameof(EnvironmentTupleFields.Part), IntermediateFieldType.Number), | ||
| 18 | new IntermediateFieldDefinition(nameof(EnvironmentTupleFields.Permanent), IntermediateFieldType.Bool), | ||
| 19 | new IntermediateFieldDefinition(nameof(EnvironmentTupleFields.System), IntermediateFieldType.Bool), | ||
| 16 | new IntermediateFieldDefinition(nameof(EnvironmentTupleFields.Component_), IntermediateFieldType.String), | 20 | new IntermediateFieldDefinition(nameof(EnvironmentTupleFields.Component_), IntermediateFieldType.String), |
| 17 | }, | 21 | }, |
| 18 | typeof(EnvironmentTuple)); | 22 | typeof(EnvironmentTuple)); |
| @@ -23,12 +27,30 @@ namespace WixToolset.Data.Tuples | |||
| 23 | { | 27 | { |
| 24 | public enum EnvironmentTupleFields | 28 | public enum EnvironmentTupleFields |
| 25 | { | 29 | { |
| 26 | Environment, | ||
| 27 | Name, | 30 | Name, |
| 28 | Value, | 31 | Value, |
| 32 | Separator, | ||
| 33 | Action, | ||
| 34 | Part, | ||
| 35 | Permanent, | ||
| 36 | System, | ||
| 29 | Component_, | 37 | Component_, |
| 30 | } | 38 | } |
| 31 | 39 | ||
| 40 | public enum EnvironmentActionType | ||
| 41 | { | ||
| 42 | Set, | ||
| 43 | Create, | ||
| 44 | Remove | ||
| 45 | } | ||
| 46 | |||
| 47 | public enum EnvironmentPartType | ||
| 48 | { | ||
| 49 | All, | ||
| 50 | First, | ||
| 51 | Last | ||
| 52 | } | ||
| 53 | |||
| 32 | public class EnvironmentTuple : IntermediateTuple | 54 | public class EnvironmentTuple : IntermediateTuple |
| 33 | { | 55 | { |
| 34 | public EnvironmentTuple() : base(TupleDefinitions.Environment, null, null) | 56 | public EnvironmentTuple() : base(TupleDefinitions.Environment, null, null) |
| @@ -41,12 +63,6 @@ namespace WixToolset.Data.Tuples | |||
| 41 | 63 | ||
| 42 | public IntermediateField this[EnvironmentTupleFields index] => this.Fields[(int)index]; | 64 | public IntermediateField this[EnvironmentTupleFields index] => this.Fields[(int)index]; |
| 43 | 65 | ||
| 44 | public string Environment | ||
| 45 | { | ||
| 46 | get => (string)this.Fields[(int)EnvironmentTupleFields.Environment]?.Value; | ||
| 47 | set => this.Set((int)EnvironmentTupleFields.Environment, value); | ||
| 48 | } | ||
| 49 | |||
| 50 | public string Name | 66 | public string Name |
| 51 | { | 67 | { |
| 52 | get => (string)this.Fields[(int)EnvironmentTupleFields.Name]?.Value; | 68 | get => (string)this.Fields[(int)EnvironmentTupleFields.Name]?.Value; |
| @@ -59,6 +75,36 @@ namespace WixToolset.Data.Tuples | |||
| 59 | set => this.Set((int)EnvironmentTupleFields.Value, value); | 75 | set => this.Set((int)EnvironmentTupleFields.Value, value); |
| 60 | } | 76 | } |
| 61 | 77 | ||
| 78 | public string Separator | ||
| 79 | { | ||
| 80 | get => (string)this.Fields[(int)EnvironmentTupleFields.Separator]?.Value; | ||
| 81 | set => this.Set((int)EnvironmentTupleFields.Separator, value); | ||
| 82 | } | ||
| 83 | |||
| 84 | public EnvironmentActionType? Action | ||
| 85 | { | ||
| 86 | get => (EnvironmentActionType?)this.Fields[(int)EnvironmentTupleFields.Action].AsNullableNumber(); | ||
| 87 | set => this.Set((int)EnvironmentTupleFields.Action, (int)value); | ||
| 88 | } | ||
| 89 | |||
| 90 | public EnvironmentPartType? Part | ||
| 91 | { | ||
| 92 | get => (EnvironmentPartType?)this.Fields[(int)EnvironmentTupleFields.Part].AsNullableNumber(); | ||
| 93 | set => this.Set((int)EnvironmentTupleFields.Part, (int)value); | ||
| 94 | } | ||
| 95 | |||
| 96 | public bool Permanent | ||
| 97 | { | ||
| 98 | get => this.Fields[(int)EnvironmentTupleFields.Permanent].AsBool(); | ||
| 99 | set => this.Set((int)EnvironmentTupleFields.Permanent, value); | ||
| 100 | } | ||
| 101 | |||
| 102 | public bool System | ||
| 103 | { | ||
| 104 | get => this.Fields[(int)EnvironmentTupleFields.System].AsBool(); | ||
| 105 | set => this.Set((int)EnvironmentTupleFields.System, value); | ||
| 106 | } | ||
| 107 | |||
| 62 | public string Component_ | 108 | public string Component_ |
| 63 | { | 109 | { |
| 64 | get => (string)this.Fields[(int)EnvironmentTupleFields.Component_]?.Value; | 110 | get => (string)this.Fields[(int)EnvironmentTupleFields.Component_]?.Value; |
