@joebigelow / wix / commits / c22120fa

Rename MsiAssemblyTuple to AssemblyTuple

Rob Mensching committed May 23, 2019 at 15:34 UTC c22120fa0311033b06e2cbc78190fc9066e86e42
3 files changed +99 -102
src/WixToolset.Data/Tuples/AssemblyTuple.cs new
+96
@@ -0,0 +1,96 @@
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 Assembly = new IntermediateTupleDefinition(
10 + TupleDefinitionType.Assembly,
11 + new[]
12 + {
13 + new IntermediateFieldDefinition(nameof(AssemblyTupleFields.ComponentRef), IntermediateFieldType.String),
14 + new IntermediateFieldDefinition(nameof(AssemblyTupleFields.FeatureRef), IntermediateFieldType.String),
15 + new IntermediateFieldDefinition(nameof(AssemblyTupleFields.ManifestFileRef), IntermediateFieldType.String),
16 + new IntermediateFieldDefinition(nameof(AssemblyTupleFields.ApplicationFileRef), IntermediateFieldType.String),
17 + new IntermediateFieldDefinition(nameof(AssemblyTupleFields.Attributes), IntermediateFieldType.Number),
18 + new IntermediateFieldDefinition(nameof(AssemblyTupleFields.ProcessorArchitecture), IntermediateFieldType.String),
19 + },
20 + typeof(AssemblyTuple));
21 + }
22 +}
23 +
24 +namespace WixToolset.Data.Tuples
25 +{
26 + public enum AssemblyTupleFields
27 + {
28 + ComponentRef,
29 + FeatureRef,
30 + ManifestFileRef,
31 + ApplicationFileRef,
32 + Attributes,
33 + ProcessorArchitecture,
34 + }
35 +
36 + public enum AssemblyType
37 + {
38 + /// <summary>File is not an assembly.</summary>
39 + NotAnAssembly,
40 +
41 + /// <summary>File is a Common Language Runtime Assembly.</summary>
42 + DotNetAssembly,
43 +
44 + /// <summary>File is Win32 SxS assembly.</summary>
45 + Win32Assembly,
46 + }
47 +
48 + public class AssemblyTuple : IntermediateTuple
49 + {
50 + public AssemblyTuple() : base(TupleDefinitions.Assembly, null, null)
51 + {
52 + }
53 +
54 + public AssemblyTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(TupleDefinitions.Assembly, sourceLineNumber, id)
55 + {
56 + }
57 +
58 + public IntermediateField this[AssemblyTupleFields index] => this.Fields[(int)index];
59 +
60 + public string ComponentRef
61 + {
62 + get => (string)this.Fields[(int)AssemblyTupleFields.ComponentRef];
63 + set => this.Set((int)AssemblyTupleFields.ComponentRef, value);
64 + }
65 +
66 + public string FeatureRef
67 + {
68 + get => (string)this.Fields[(int)AssemblyTupleFields.FeatureRef];
69 + set => this.Set((int)AssemblyTupleFields.FeatureRef, value);
70 + }
71 +
72 + public string ManifestFileRef
73 + {
74 + get => (string)this.Fields[(int)AssemblyTupleFields.ManifestFileRef];
75 + set => this.Set((int)AssemblyTupleFields.ManifestFileRef, value);
76 + }
77 +
78 + public string ApplicationFileRef
79 + {
80 + get => (string)this.Fields[(int)AssemblyTupleFields.ApplicationFileRef];
81 + set => this.Set((int)AssemblyTupleFields.ApplicationFileRef, value);
82 + }
83 +
84 + public AssemblyType Type
85 + {
86 + get => (AssemblyType)this.Fields[(int)AssemblyTupleFields.Attributes].AsNumber();
87 + set => this.Set((int)AssemblyTupleFields.Attributes, (int)value);
88 + }
89 +
90 + public string ProcessorArchitecture
91 + {
92 + get => (string)this.Fields[(int)AssemblyTupleFields.ProcessorArchitecture];
93 + set => this.Set((int)AssemblyTupleFields.ProcessorArchitecture, value);
94 + }
95 + }
96 +}
src/WixToolset.Data/Tuples/MsiAssemblyTuple.cs deleted
-99
@@ -1,99 +0,0 @@
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 MsiAssembly = new IntermediateTupleDefinition(
10 - TupleDefinitionType.MsiAssembly,
11 - new[]
12 - {
13 - new IntermediateFieldDefinition(nameof(MsiAssemblyTupleFields.ComponentRef), IntermediateFieldType.String),
14 - new IntermediateFieldDefinition(nameof(MsiAssemblyTupleFields.FeatureRef), IntermediateFieldType.String),
15 - new IntermediateFieldDefinition(nameof(MsiAssemblyTupleFields.ManifestFileRef), IntermediateFieldType.String),
16 - new IntermediateFieldDefinition(nameof(MsiAssemblyTupleFields.ApplicationFileRef), IntermediateFieldType.String),
17 - new IntermediateFieldDefinition(nameof(MsiAssemblyTupleFields.Attributes), IntermediateFieldType.Number),
18 - //new IntermediateFieldDefinition(nameof(MsiAssemblyTupleFields.ProcessorArchitecture), IntermediateFieldType.String),
19 - },
20 - typeof(MsiAssemblyTuple));
21 - }
22 -}
23 -
24 -namespace WixToolset.Data.Tuples
25 -{
26 - public enum MsiAssemblyTupleFields
27 - {
28 - ComponentRef,
29 - FeatureRef,
30 - ManifestFileRef,
31 - ApplicationFileRef,
32 - Attributes,
33 - //ProcessorArchitecture,
34 - }
35 -
36 - /// <summary>
37 - /// Every file row has an assembly type.
38 - /// </summary>
39 - public enum AssemblyType
40 - {
41 - /// <summary>File is not an assembly.</summary>
42 - NotAnAssembly,
43 -
44 - /// <summary>File is a Common Language Runtime Assembly.</summary>
45 - DotNetAssembly,
46 -
47 - /// <summary>File is Win32 SxS assembly.</summary>
48 - Win32Assembly,
49 - }
50 -
51 - public class MsiAssemblyTuple : IntermediateTuple
52 - {
53 - public MsiAssemblyTuple() : base(TupleDefinitions.MsiAssembly, null, null)
54 - {
55 - }
56 -
57 - public MsiAssemblyTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(TupleDefinitions.MsiAssembly, sourceLineNumber, id)
58 - {
59 - }
60 -
61 - public IntermediateField this[MsiAssemblyTupleFields index] => this.Fields[(int)index];
62 -
63 - public string ComponentRef
64 - {
65 - get => (string)this.Fields[(int)MsiAssemblyTupleFields.ComponentRef];
66 - set => this.Set((int)MsiAssemblyTupleFields.ComponentRef, value);
67 - }
68 -
69 - public string FeatureRef
70 - {
71 - get => (string)this.Fields[(int)MsiAssemblyTupleFields.FeatureRef];
72 - set => this.Set((int)MsiAssemblyTupleFields.FeatureRef, value);
73 - }
74 -
75 - public string ManifestFileRef
76 - {
77 - get => (string)this.Fields[(int)MsiAssemblyTupleFields.ManifestFileRef];
78 - set => this.Set((int)MsiAssemblyTupleFields.ManifestFileRef, value);
79 - }
80 -
81 - public string ApplicationFileRef
82 - {
83 - get => (string)this.Fields[(int)MsiAssemblyTupleFields.ApplicationFileRef];
84 - set => this.Set((int)MsiAssemblyTupleFields.ApplicationFileRef, value);
85 - }
86 -
87 - public AssemblyType Type
88 - {
89 - get => (AssemblyType)this.Fields[(int)MsiAssemblyTupleFields.Attributes].AsNumber();
90 - set => this.Set((int)MsiAssemblyTupleFields.Attributes, (int)value);
91 - }
92 -
93 - //public string ProcessorArchitecture
94 - //{
95 - // get => (string)this.Fields[(int)MsiAssemblyTupleFields.ProcessorArchitecture];
96 - // set => this.Set((int)MsiAssemblyTupleFields.ProcessorArchitecture, value);
97 - //}
98 - }
99 -}
\ No newline at end of file
src/WixToolset.Data/Tuples/TupleDefinitions.cs
+3 -3
@@ -70,7 +70,7 @@ namespace WixToolset.Data
70 ModuleSignature,
71 ModuleSubstitution,
72 MoveFile,
73 - MsiAssembly,
73 + Assembly,
74 MsiAssemblyName,
75 MsiDigitalCertificate,
76 MsiDigitalSignature,
@@ -402,8 +402,8 @@ namespace WixToolset.Data
402 case TupleDefinitionType.MoveFile:
403 return TupleDefinitions.MoveFile;
404
405 - case TupleDefinitionType.MsiAssembly:
406 - return TupleDefinitions.MsiAssembly;
405 + case TupleDefinitionType.Assembly:
406 + return TupleDefinitions.Assembly;
407
408 case TupleDefinitionType.MsiAssemblyName:
409 return TupleDefinitions.MsiAssemblyName;