From cece10e037c6daacc8d2def1a9057882aec47fe4 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Mon, 7 Oct 2019 07:32:59 -0700 Subject: Add support for long fields and fix up Bundle and many other tuples --- src/WixToolset.Data/Tuples/WixFileSearchTuple.cs | 33 +++++++++++++++--------- 1 file changed, 21 insertions(+), 12 deletions(-) (limited to 'src/WixToolset.Data/Tuples/WixFileSearchTuple.cs') diff --git a/src/WixToolset.Data/Tuples/WixFileSearchTuple.cs b/src/WixToolset.Data/Tuples/WixFileSearchTuple.cs index 27c5cc83..4c0cedf3 100644 --- a/src/WixToolset.Data/Tuples/WixFileSearchTuple.cs +++ b/src/WixToolset.Data/Tuples/WixFileSearchTuple.cs @@ -10,7 +10,6 @@ namespace WixToolset.Data TupleDefinitionType.WixFileSearch, new[] { - new IntermediateFieldDefinition(nameof(WixFileSearchTupleFields.WixSearchRef), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixFileSearchTupleFields.Path), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixFileSearchTupleFields.MinVersion), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixFileSearchTupleFields.MaxVersion), IntermediateFieldType.String), @@ -27,9 +26,10 @@ namespace WixToolset.Data namespace WixToolset.Data.Tuples { + using System; + public enum WixFileSearchTupleFields { - WixSearchRef, Path, MinVersion, MaxVersion, @@ -41,6 +41,21 @@ namespace WixToolset.Data.Tuples Attributes, } + [Flags] + public enum WixFileSearchAttributes + { + Default = 0x001, + MinVersionInclusive = 0x002, + MaxVersionInclusive = 0x004, + MinSizeInclusive = 0x008, + MaxSizeInclusive = 0x010, + MinDateInclusive = 0x020, + MaxDateInclusive = 0x040, + WantVersion = 0x080, + WantExists = 0x100, + IsDirectory = 0x200, + } + public class WixFileSearchTuple : IntermediateTuple { public WixFileSearchTuple() : base(TupleDefinitions.WixFileSearch, null, null) @@ -53,12 +68,6 @@ namespace WixToolset.Data.Tuples public IntermediateField this[WixFileSearchTupleFields index] => this.Fields[(int)index]; - public string WixSearchRef - { - get => (string)this.Fields[(int)WixFileSearchTupleFields.WixSearchRef]; - set => this.Set((int)WixFileSearchTupleFields.WixSearchRef, value); - } - public string Path { get => (string)this.Fields[(int)WixFileSearchTupleFields.Path]; @@ -107,10 +116,10 @@ namespace WixToolset.Data.Tuples set => this.Set((int)WixFileSearchTupleFields.Languages, value); } - public int Attributes + public WixFileSearchAttributes Attributes { - get => (int)this.Fields[(int)WixFileSearchTupleFields.Attributes]; - set => this.Set((int)WixFileSearchTupleFields.Attributes, value); + get => (WixFileSearchAttributes)this.Fields[(int)WixFileSearchTupleFields.Attributes].AsNumber(); + set => this.Set((int)WixFileSearchTupleFields.Attributes, (int)value); } } -} \ No newline at end of file +} -- cgit v1.2.3-55-g6feb