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/ComponentTuple.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/ComponentTuple.cs')
| -rw-r--r-- | src/WixToolset.Data/Tuples/ComponentTuple.cs | 81 |
1 files changed, 76 insertions, 5 deletions
diff --git a/src/WixToolset.Data/Tuples/ComponentTuple.cs b/src/WixToolset.Data/Tuples/ComponentTuple.cs index 8d679609..609852bd 100644 --- a/src/WixToolset.Data/Tuples/ComponentTuple.cs +++ b/src/WixToolset.Data/Tuples/ComponentTuple.cs | |||
| @@ -13,9 +13,17 @@ namespace WixToolset.Data | |||
| 13 | new IntermediateFieldDefinition(nameof(ComponentTupleFields.Component), IntermediateFieldType.String), | 13 | new IntermediateFieldDefinition(nameof(ComponentTupleFields.Component), IntermediateFieldType.String), |
| 14 | new IntermediateFieldDefinition(nameof(ComponentTupleFields.ComponentId), IntermediateFieldType.String), | 14 | new IntermediateFieldDefinition(nameof(ComponentTupleFields.ComponentId), IntermediateFieldType.String), |
| 15 | new IntermediateFieldDefinition(nameof(ComponentTupleFields.Directory_), IntermediateFieldType.String), | 15 | new IntermediateFieldDefinition(nameof(ComponentTupleFields.Directory_), IntermediateFieldType.String), |
| 16 | new IntermediateFieldDefinition(nameof(ComponentTupleFields.Attributes), IntermediateFieldType.Number), | 16 | new IntermediateFieldDefinition(nameof(ComponentTupleFields.Location), IntermediateFieldType.Number), |
| 17 | new IntermediateFieldDefinition(nameof(ComponentTupleFields.DisableRegistryReflection), IntermediateFieldType.Bool), | ||
| 18 | new IntermediateFieldDefinition(nameof(ComponentTupleFields.NeverOverwrite), IntermediateFieldType.Bool), | ||
| 19 | new IntermediateFieldDefinition(nameof(ComponentTupleFields.Permanent), IntermediateFieldType.Bool), | ||
| 20 | new IntermediateFieldDefinition(nameof(ComponentTupleFields.SharedDllRefCount), IntermediateFieldType.Bool), | ||
| 21 | new IntermediateFieldDefinition(nameof(ComponentTupleFields.Transitive), IntermediateFieldType.Bool), | ||
| 22 | new IntermediateFieldDefinition(nameof(ComponentTupleFields.UninstallWhenSuperseded), IntermediateFieldType.Bool), | ||
| 23 | new IntermediateFieldDefinition(nameof(ComponentTupleFields.Win64), IntermediateFieldType.Bool), | ||
| 17 | new IntermediateFieldDefinition(nameof(ComponentTupleFields.Condition), IntermediateFieldType.String), | 24 | new IntermediateFieldDefinition(nameof(ComponentTupleFields.Condition), IntermediateFieldType.String), |
| 18 | new IntermediateFieldDefinition(nameof(ComponentTupleFields.KeyPath), IntermediateFieldType.String), | 25 | new IntermediateFieldDefinition(nameof(ComponentTupleFields.KeyPath), IntermediateFieldType.String), |
| 26 | new IntermediateFieldDefinition(nameof(ComponentTupleFields.KeyPathType), IntermediateFieldType.Number), | ||
| 19 | }, | 27 | }, |
| 20 | typeof(ComponentTuple)); | 28 | typeof(ComponentTuple)); |
| 21 | } | 29 | } |
| @@ -28,9 +36,24 @@ namespace WixToolset.Data.Tuples | |||
| 28 | Component, | 36 | Component, |
| 29 | ComponentId, | 37 | ComponentId, |
| 30 | Directory_, | 38 | Directory_, |
| 31 | Attributes, | 39 | Location, |
| 40 | DisableRegistryReflection, | ||
| 41 | NeverOverwrite, | ||
| 42 | Permanent, | ||
| 43 | SharedDllRefCount, | ||
| 44 | Transitive, | ||
| 45 | UninstallWhenSuperseded, | ||
| 46 | Win64, | ||
| 32 | Condition, | 47 | Condition, |
| 33 | KeyPath, | 48 | KeyPath, |
| 49 | KeyPathType, | ||
| 50 | } | ||
| 51 | |||
| 52 | public enum ComponentLocation | ||
| 53 | { | ||
| 54 | LocalOnly, | ||
| 55 | SourceOnly, | ||
| 56 | Either | ||
| 34 | } | 57 | } |
| 35 | 58 | ||
| 36 | public class ComponentTuple : IntermediateTuple | 59 | public class ComponentTuple : IntermediateTuple |
| @@ -63,10 +86,52 @@ namespace WixToolset.Data.Tuples | |||
| 63 | set => this.Set((int)ComponentTupleFields.Directory_, value); | 86 | set => this.Set((int)ComponentTupleFields.Directory_, value); |
| 64 | } | 87 | } |
| 65 | 88 | ||
| 66 | public int Attributes | 89 | public ComponentLocation Location |
| 90 | { | ||
| 91 | get => (ComponentLocation)this.Fields[(int)ComponentTupleFields.Location].AsNumber(); | ||
| 92 | set => this.Set((int)ComponentTupleFields.Location, (int)value); | ||
| 93 | } | ||
| 94 | |||
| 95 | public bool DisableRegistryReflection | ||
| 96 | { | ||
| 97 | get => this.Fields[(int)ComponentTupleFields.DisableRegistryReflection].AsBool(); | ||
| 98 | set => this.Set((int)ComponentTupleFields.DisableRegistryReflection, value); | ||
| 99 | } | ||
| 100 | |||
| 101 | public bool NeverOverwrite | ||
| 67 | { | 102 | { |
| 68 | get => (int)this.Fields[(int)ComponentTupleFields.Attributes]?.Value; | 103 | get => this.Fields[(int)ComponentTupleFields.NeverOverwrite].AsBool(); |
| 69 | set => this.Set((int)ComponentTupleFields.Attributes, value); | 104 | set => this.Set((int)ComponentTupleFields.NeverOverwrite, value); |
| 105 | } | ||
| 106 | |||
| 107 | public bool Permanent | ||
| 108 | { | ||
| 109 | get => this.Fields[(int)ComponentTupleFields.Permanent].AsBool(); | ||
| 110 | set => this.Set((int)ComponentTupleFields.Permanent, value); | ||
| 111 | } | ||
| 112 | |||
| 113 | public bool SharedDllRefCount | ||
| 114 | { | ||
| 115 | get => this.Fields[(int)ComponentTupleFields.SharedDllRefCount].AsBool(); | ||
| 116 | set => this.Set((int)ComponentTupleFields.SharedDllRefCount, value); | ||
| 117 | } | ||
| 118 | |||
| 119 | public bool Transitive | ||
| 120 | { | ||
| 121 | get => this.Fields[(int)ComponentTupleFields.Transitive].AsBool(); | ||
| 122 | set => this.Set((int)ComponentTupleFields.Transitive, value); | ||
| 123 | } | ||
| 124 | |||
| 125 | public bool UninstallWhenSuperseded | ||
| 126 | { | ||
| 127 | get => this.Fields[(int)ComponentTupleFields.UninstallWhenSuperseded].AsBool(); | ||
| 128 | set => this.Set((int)ComponentTupleFields.UninstallWhenSuperseded, value); | ||
| 129 | } | ||
| 130 | |||
| 131 | public bool Win64 | ||
| 132 | { | ||
| 133 | get => this.Fields[(int)ComponentTupleFields.Win64].AsBool(); | ||
| 134 | set => this.Set((int)ComponentTupleFields.Win64, value); | ||
| 70 | } | 135 | } |
| 71 | 136 | ||
| 72 | public string Condition | 137 | public string Condition |
| @@ -80,5 +145,11 @@ namespace WixToolset.Data.Tuples | |||
| 80 | get => (string)this.Fields[(int)ComponentTupleFields.KeyPath]?.Value; | 145 | get => (string)this.Fields[(int)ComponentTupleFields.KeyPath]?.Value; |
| 81 | set => this.Set((int)ComponentTupleFields.KeyPath, value); | 146 | set => this.Set((int)ComponentTupleFields.KeyPath, value); |
| 82 | } | 147 | } |
| 148 | |||
| 149 | public ComponentKeyPathType KeyPathType | ||
| 150 | { | ||
| 151 | get => (ComponentKeyPathType)this.Fields[(int)ComponentTupleFields.KeyPathType].AsNumber(); | ||
| 152 | set => this.Set((int)ComponentTupleFields.KeyPathType, (int)value); | ||
| 153 | } | ||
| 83 | } | 154 | } |
| 84 | } \ No newline at end of file | 155 | } \ No newline at end of file |
