From c22120fa0311033b06e2cbc78190fc9066e86e42 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 23 May 2019 15:34:42 -0700 Subject: Rename MsiAssemblyTuple to AssemblyTuple --- src/WixToolset.Data/Tuples/AssemblyTuple.cs | 96 +++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 src/WixToolset.Data/Tuples/AssemblyTuple.cs (limited to 'src/WixToolset.Data/Tuples/AssemblyTuple.cs') diff --git a/src/WixToolset.Data/Tuples/AssemblyTuple.cs b/src/WixToolset.Data/Tuples/AssemblyTuple.cs new file mode 100644 index 00000000..15367cc3 --- /dev/null +++ b/src/WixToolset.Data/Tuples/AssemblyTuple.cs @@ -0,0 +1,96 @@ +// 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. + +namespace WixToolset.Data +{ + using WixToolset.Data.Tuples; + + public static partial class TupleDefinitions + { + public static readonly IntermediateTupleDefinition Assembly = new IntermediateTupleDefinition( + TupleDefinitionType.Assembly, + new[] + { + new IntermediateFieldDefinition(nameof(AssemblyTupleFields.ComponentRef), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(AssemblyTupleFields.FeatureRef), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(AssemblyTupleFields.ManifestFileRef), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(AssemblyTupleFields.ApplicationFileRef), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(AssemblyTupleFields.Attributes), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(AssemblyTupleFields.ProcessorArchitecture), IntermediateFieldType.String), + }, + typeof(AssemblyTuple)); + } +} + +namespace WixToolset.Data.Tuples +{ + public enum AssemblyTupleFields + { + ComponentRef, + FeatureRef, + ManifestFileRef, + ApplicationFileRef, + Attributes, + ProcessorArchitecture, + } + + public enum AssemblyType + { + /// File is not an assembly. + NotAnAssembly, + + /// File is a Common Language Runtime Assembly. + DotNetAssembly, + + /// File is Win32 SxS assembly. + Win32Assembly, + } + + public class AssemblyTuple : IntermediateTuple + { + public AssemblyTuple() : base(TupleDefinitions.Assembly, null, null) + { + } + + public AssemblyTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(TupleDefinitions.Assembly, sourceLineNumber, id) + { + } + + public IntermediateField this[AssemblyTupleFields index] => this.Fields[(int)index]; + + public string ComponentRef + { + get => (string)this.Fields[(int)AssemblyTupleFields.ComponentRef]; + set => this.Set((int)AssemblyTupleFields.ComponentRef, value); + } + + public string FeatureRef + { + get => (string)this.Fields[(int)AssemblyTupleFields.FeatureRef]; + set => this.Set((int)AssemblyTupleFields.FeatureRef, value); + } + + public string ManifestFileRef + { + get => (string)this.Fields[(int)AssemblyTupleFields.ManifestFileRef]; + set => this.Set((int)AssemblyTupleFields.ManifestFileRef, value); + } + + public string ApplicationFileRef + { + get => (string)this.Fields[(int)AssemblyTupleFields.ApplicationFileRef]; + set => this.Set((int)AssemblyTupleFields.ApplicationFileRef, value); + } + + public AssemblyType Type + { + get => (AssemblyType)this.Fields[(int)AssemblyTupleFields.Attributes].AsNumber(); + set => this.Set((int)AssemblyTupleFields.Attributes, (int)value); + } + + public string ProcessorArchitecture + { + get => (string)this.Fields[(int)AssemblyTupleFields.ProcessorArchitecture]; + set => this.Set((int)AssemblyTupleFields.ProcessorArchitecture, value); + } + } +} -- cgit v1.2.3-55-g6feb