aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Data/WindowsInstaller/Rows
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2020-06-04 10:19:31 -0700
committerRob Mensching <rob@firegiant.com>2020-06-04 10:21:25 -0700
commit021565eca7be6c3307821bd9d4500a73a5c1c68f (patch)
tree01cff651cb4a487c42b8d7635aaf332e1287ed7d /src/WixToolset.Data/WindowsInstaller/Rows
parent58791d3dbffce2a96280e08fc2d36ab69571d02c (diff)
downloadwix-021565eca7be6c3307821bd9d4500a73a5c1c68f.tar.gz
wix-021565eca7be6c3307821bd9d4500a73a5c1c68f.tar.bz2
wix-021565eca7be6c3307821bd9d4500a73a5c1c68f.zip
Remove obsolete rows
Diffstat (limited to 'src/WixToolset.Data/WindowsInstaller/Rows')
-rw-r--r--src/WixToolset.Data/WindowsInstaller/Rows/WixComplexReferenceRow.cs207
-rw-r--r--src/WixToolset.Data/WindowsInstaller/Rows/WixMergeRow.cs147
-rw-r--r--src/WixToolset.Data/WindowsInstaller/Rows/WixPropertyRow.cs123
-rw-r--r--src/WixToolset.Data/WindowsInstaller/Rows/WixSimpleReferenceRow.cs61
4 files changed, 0 insertions, 538 deletions
diff --git a/src/WixToolset.Data/WindowsInstaller/Rows/WixComplexReferenceRow.cs b/src/WixToolset.Data/WindowsInstaller/Rows/WixComplexReferenceRow.cs
deleted file mode 100644
index 0e942724..00000000
--- a/src/WixToolset.Data/WindowsInstaller/Rows/WixComplexReferenceRow.cs
+++ /dev/null
@@ -1,207 +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
3namespace WixToolset.Data.WindowsInstaller.Rows
4{
5 using System;
6 using System.Diagnostics.CodeAnalysis;
7
8 /// <summary>
9 /// Specialization of a row for the WixComplexReference table.
10 /// </summary>
11 public sealed class WixComplexReferenceRow : Row, IComparable
12 {
13 /// <summary>
14 /// Creates a WixComplexReferenceRow row that belongs to a table.
15 /// </summary>
16 /// <param name="sourceLineNumbers">Original source lines for this row.</param>
17 /// <param name="table">Table this row belongs to and should get its column definitions from.</param>
18 public WixComplexReferenceRow(SourceLineNumber sourceLineNumbers, Table table)
19 : base(sourceLineNumbers, table)
20 {
21 }
22
23 public WixComplexReferenceRow(SourceLineNumber sourceLineNumbers, TableDefinition tableDefinition)
24 : base(sourceLineNumbers, tableDefinition)
25 {
26 }
27
28 /// <summary>
29 /// Gets the parent type of the complex reference.
30 /// </summary>
31 /// <value>Parent type of the complex reference.</value>
32 public ComplexReferenceParentType ParentType
33 {
34 get { return (ComplexReferenceParentType)Enum.ToObject(typeof(ComplexReferenceParentType), (int)this.Fields[1].Data); }
35 set { this.Fields[1].Data = (int)value; }
36 }
37
38 /// <summary>
39 /// Gets or sets the parent identifier of the complex reference.
40 /// </summary>
41 /// <value>Parent identifier of the complex reference.</value>
42 public string ParentId
43 {
44 get { return (string)this.Fields[0].Data; }
45 set { this.Fields[0].Data = value; }
46 }
47
48 /// <summary>
49 /// Gets the parent language of the complex reference.
50 /// </summary>
51 /// <value>Parent language of the complex reference.</value>
52 public string ParentLanguage
53 {
54 get { return (string)this.Fields[2].Data; }
55 set { this.Fields[2].Data = value; }
56 }
57
58 /// <summary>
59 /// Gets the child type of the complex reference.
60 /// </summary>
61 /// <value>Child type of the complex reference.</value>
62 public ComplexReferenceChildType ChildType
63 {
64 get { return (ComplexReferenceChildType)Enum.ToObject(typeof(ComplexReferenceChildType), (int)this.Fields[4].Data); }
65 set { this.Fields[4].Data = (int)value; }
66 }
67
68 /// <summary>
69 /// Gets the child identifier of the complex reference.
70 /// </summary>
71 /// <value>Child identifier of the complex reference.</value>
72 public string ChildId
73 {
74 get { return (string)this.Fields[3].Data; }
75 set { this.Fields[3].Data = value; }
76 }
77
78 /// <summary>
79 /// Gets if this is the primary complex reference.
80 /// </summary>
81 /// <value>true if primary complex reference.</value>
82 public bool IsPrimary
83 {
84 get
85 {
86 return (0x1 == ((int)this.Fields[5].Data & 0x1));
87 }
88
89 set
90 {
91 if (null == this.Fields[5].Data)
92 {
93 this.Fields[5].Data = 0;
94 }
95
96 if (value)
97 {
98 this.Fields[5].Data = (int)this.Fields[5].Data | 0x1;
99 }
100 else
101 {
102 this.Fields[5].Data = (int)this.Fields[5].Data & ~0x1;
103 }
104 }
105 }
106
107 /// <summary>
108 /// Determines if two complex references are equivalent.
109 /// </summary>
110 /// <param name="obj">Complex reference to compare.</param>
111 /// <returns>True if complex references are equivalent.</returns>
112 public override bool Equals(object obj)
113 {
114 return 0 == this.CompareTo(obj);
115 }
116
117 /// <summary>
118 /// Gets the hash code for the complex reference.
119 /// </summary>
120 /// <returns>Hash code for the complex reference.</returns>
121 public override int GetHashCode()
122 {
123 return this.ChildType.GetHashCode() ^ this.ChildId.GetHashCode() ^ this.ParentType.GetHashCode() ^ this.ParentLanguage.GetHashCode() ^ this.ParentId.GetHashCode() ^ this.IsPrimary.GetHashCode();
124 }
125
126 /// <summary>
127 /// Compares two complex references.
128 /// </summary>
129 /// <param name="obj">Complex reference to compare to.</param>
130 /// <returns>Zero if the objects are equivalent, negative number if the provided object is less, positive if greater.</returns>
131 public int CompareTo(object obj)
132 {
133 int comparison = this.CompareToWithoutConsideringPrimary(obj);
134 if (0 == comparison)
135 {
136 comparison = ((WixComplexReferenceRow)obj).IsPrimary.CompareTo(this.IsPrimary); // Note: the order of these is purposely switched to ensure that "Yes" is lower than "No" and "NotSet"
137 }
138 return comparison;
139 }
140
141 /// <summary>
142 /// Compares two complex references without considering the primary bit.
143 /// </summary>
144 /// <param name="obj">Complex reference to compare to.</param>
145 /// <returns>Zero if the objects are equivalent, negative number if the provided object is less, positive if greater.</returns>
146 [SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", MessageId = "System.ArgumentException.#ctor(System.String,System.String)")]
147 public int CompareToWithoutConsideringPrimary(object obj)
148 {
149 var other = obj as WixComplexReferenceRow ?? throw new ArgumentNullException(nameof(obj));
150
151 int comparison = this.ChildType - other.ChildType;
152 if (0 == comparison)
153 {
154 comparison = String.Compare(this.ChildId, other.ChildId, StringComparison.Ordinal);
155 if (0 == comparison)
156 {
157 comparison = this.ParentType - other.ParentType;
158 if (0 == comparison)
159 {
160 string thisParentLanguage = null == this.ParentLanguage ? String.Empty : this.ParentLanguage;
161 string otherParentLanguage = null == other.ParentLanguage ? String.Empty : other.ParentLanguage;
162 comparison = String.Compare(thisParentLanguage, otherParentLanguage, StringComparison.Ordinal);
163 if (0 == comparison)
164 {
165 comparison = String.Compare(this.ParentId, other.ParentId, StringComparison.Ordinal);
166 }
167 }
168 }
169 }
170
171 return comparison;
172 }
173
174 /// <summary>
175 /// Creates a shallow copy of the ComplexReference.
176 /// </summary>
177 /// <returns>A shallow copy of the ComplexReference.</returns>
178 public WixComplexReferenceRow Clone()
179 {
180 WixComplexReferenceRow wixComplexReferenceRow = new WixComplexReferenceRow(this.SourceLineNumbers, this.Table);
181 wixComplexReferenceRow.ParentType = this.ParentType;
182 wixComplexReferenceRow.ParentId = this.ParentId;
183 wixComplexReferenceRow.ParentLanguage = this.ParentLanguage;
184 wixComplexReferenceRow.ChildType = this.ChildType;
185 wixComplexReferenceRow.ChildId = this.ChildId;
186 wixComplexReferenceRow.IsPrimary = this.IsPrimary;
187
188 return wixComplexReferenceRow;
189 }
190
191 /// <summary>
192 /// Changes all of the parent references to point to the passed in parent reference.
193 /// </summary>
194 /// <param name="parent">New parent complex reference.</param>
195 public void Reparent(WixComplexReferenceRow parent)
196 {
197 this.ParentId = parent.ParentId;
198 this.ParentLanguage = parent.ParentLanguage;
199 this.ParentType = parent.ParentType;
200
201 if (!this.IsPrimary)
202 {
203 this.IsPrimary = parent.IsPrimary;
204 }
205 }
206 }
207}
diff --git a/src/WixToolset.Data/WindowsInstaller/Rows/WixMergeRow.cs b/src/WixToolset.Data/WindowsInstaller/Rows/WixMergeRow.cs
deleted file mode 100644
index ac60452e..00000000
--- a/src/WixToolset.Data/WindowsInstaller/Rows/WixMergeRow.cs
+++ /dev/null
@@ -1,147 +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
3namespace WixToolset.Data.WindowsInstaller.Rows
4{
5 using System;
6 using System.Globalization;
7
8 /// <summary>
9 /// Specialization of a row for tracking merge statements.
10 /// </summary>
11 public sealed class WixMergeRow : Row
12 {
13 /// <summary>
14 /// Creates a Merge row that does not belong to a table.
15 /// </summary>
16 /// <param name="sourceLineNumbers">Original source lines for this row.</param>
17 /// <param name="tableDef">TableDefinition this Merge row belongs to and should get its column definitions from.</param>
18 public WixMergeRow(SourceLineNumber sourceLineNumbers, TableDefinition tableDef) :
19 base(sourceLineNumbers, tableDef)
20 {
21 }
22
23 /// <summary>Creates a Merge row that belongs to a table.</summary>
24 /// <param name="sourceLineNumbers">Original source lines for this row.</param>
25 /// <param name="table">Table this Merge row belongs to and should get its column definitions from.</param>
26 public WixMergeRow(SourceLineNumber sourceLineNumbers, Table table) :
27 base(sourceLineNumbers, table)
28 {
29 }
30
31 /// <summary>
32 /// Gets and sets the id for a merge row.
33 /// </summary>
34 /// <value>Id for the row.</value>
35 public string Id
36 {
37 get { return (string)this.Fields[0].Data; }
38 set { this.Fields[0].Data = value; }
39 }
40
41 /// <summary>
42 /// Gets and sets the language for a merge row.
43 /// </summary>
44 /// <value>Language for the row.</value>
45 public string Language
46 {
47 get { return (string)this.Fields[1].Data; }
48 set { this.Fields[1].Data = value; }
49 }
50
51 /// <summary>
52 /// Gets and sets the directory for a merge row.
53 /// </summary>
54 /// <value>Direcotory for the row.</value>
55 public string Directory
56 {
57 get { return (string)this.Fields[2].Data; }
58 set { this.Fields[2].Data = value; }
59 }
60
61 /// <summary>
62 /// Gets and sets the path to the merge module for a merge row.
63 /// </summary>
64 /// <value>Source path for the row.</value>
65 public string SourceFile
66 {
67 get { return (string)this.Fields[3].Data; }
68 set { this.Fields[3].Data = value; }
69 }
70
71 /// <summary>
72 /// Gets and sets the disk id the merge module should be placed on for a merge row.
73 /// </summary>
74 /// <value>Disk identifier for row.</value>
75 public int DiskId
76 {
77 get { return (int)this.Fields[4].Data; }
78 set { this.Fields[4].Data = value; }
79 }
80
81 /// <summary>
82 /// Gets and sets the compression value for a merge row.
83 /// </summary>
84 /// <value>Compression for a merge row.</value>
85 public YesNoType FileCompression
86 {
87 get
88 {
89 if (null == this.Fields[5].Data)
90 {
91 return YesNoType.NotSet;
92 }
93 else if (1 == (int)this.Fields[5].Data)
94 {
95 return YesNoType.Yes;
96 }
97 else if (0 == (int)this.Fields[5].Data)
98 {
99 return YesNoType.No;
100 }
101 else
102 {
103 throw new InvalidOperationException(String.Format(CultureInfo.CurrentUICulture, WixDataStrings.EXP_MergeTableFileCompressionColumnContainsInvalidValue, this.Fields[5].Data));
104 }
105 }
106 set
107 {
108 if (YesNoType.Yes == value)
109 {
110 this.Fields[5].Data = 1;
111 }
112 else if (YesNoType.No == value)
113 {
114 this.Fields[5].Data = 0;
115 }
116 else if (YesNoType.NotSet == value)
117 {
118 this.Fields[5].Data = null;
119 }
120 else
121 {
122 throw new InvalidOperationException(String.Format(CultureInfo.CurrentUICulture, WixDataStrings.EXP_CannotSetMergeTableFileCompressionColumnToInvalidValue, value));
123 }
124 }
125 }
126
127 /// <summary>
128 /// Gets and sets the configuration data for a merge row.
129 /// </summary>
130 /// <value>Comma delimited string of "name=value" pairs.</value>
131 public string ConfigurationData
132 {
133 get { return (string)this.Fields[6].Data; }
134 set { this.Fields[6].Data = value; }
135 }
136
137 /// <summary>
138 /// Gets and sets the primary feature for a merge row.
139 /// </summary>
140 /// <value>The primary feature for a merge row.</value>
141 public string Feature
142 {
143 get { return (string)this.Fields[7].Data; }
144 set { this.Fields[7].Data = value; }
145 }
146 }
147}
diff --git a/src/WixToolset.Data/WindowsInstaller/Rows/WixPropertyRow.cs b/src/WixToolset.Data/WindowsInstaller/Rows/WixPropertyRow.cs
deleted file mode 100644
index 8a54d36e..00000000
--- a/src/WixToolset.Data/WindowsInstaller/Rows/WixPropertyRow.cs
+++ /dev/null
@@ -1,123 +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
3namespace WixToolset.Data.WindowsInstaller.Rows
4{
5 using System;
6 using System.Globalization;
7
8 /// <summary>
9 /// Specialization of a row for the WixProperty table.
10 /// </summary>
11 public sealed class WixPropertyRow : Row
12 {
13 /// <summary>Creates a WixProperty row that belongs to a table.</summary>
14 /// <param name="sourceLineNumbers">Original source lines for this row.</param>
15 /// <param name="table">Table this WixProperty row belongs to and should get its column definitions from.</param>
16 public WixPropertyRow(SourceLineNumber sourceLineNumbers, Table table) :
17 base(sourceLineNumbers, table)
18 {
19 }
20
21 public WixPropertyRow(SourceLineNumber sourceLineNumbers, TableDefinition tableDefinition) :
22 base(sourceLineNumbers, tableDefinition)
23 {
24 }
25
26 /// <summary>
27 /// Gets and sets the id for this property row.
28 /// </summary>
29 /// <value>Id for the property.</value>
30 public string Id
31 {
32 get { return (string)this.Fields[0].Data; }
33 set { this.Fields[0].Data = value; }
34 }
35
36 /// <summary>
37 /// Gets and sets if this is an admin property row.
38 /// </summary>
39 /// <value>Flag if this is an admin property.</value>
40 public bool Admin
41 {
42 get
43 {
44 return (0x1 == (Convert.ToInt32(this.Fields[1].Data, CultureInfo.InvariantCulture) & 0x1));
45 }
46
47 set
48 {
49 if (null == this.Fields[1].Data)
50 {
51 this.Fields[1].Data = 0;
52 }
53
54 if (value)
55 {
56 this.Fields[1].Data = (int)this.Fields[1].Data | 0x1;
57 }
58 else
59 {
60 this.Fields[1].Data = (int)this.Fields[1].Data & ~0x1;
61 }
62 }
63 }
64
65 /// <summary>
66 /// Gets and sets if this is a hidden property row.
67 /// </summary>
68 /// <value>Flag if this is a hidden property.</value>
69 public bool Hidden
70 {
71 get
72 {
73 return (0x2 == (Convert.ToInt32(this.Fields[1].Data, CultureInfo.InvariantCulture) & 0x2));
74 }
75
76 set
77 {
78 if (null == this.Fields[1].Data)
79 {
80 this.Fields[1].Data = 0;
81 }
82
83 if (value)
84 {
85 this.Fields[1].Data = (int)this.Fields[1].Data | 0x2;
86 }
87 else
88 {
89 this.Fields[1].Data = (int)this.Fields[1].Data & ~0x2;
90 }
91 }
92 }
93
94 /// <summary>
95 /// Gets and sets if this is a secure property row.
96 /// </summary>
97 /// <value>Flag if this is a secure property.</value>
98 public bool Secure
99 {
100 get
101 {
102 return (0x4 == (Convert.ToInt32(this.Fields[1].Data, CultureInfo.InvariantCulture) & 0x4));
103 }
104
105 set
106 {
107 if (null == this.Fields[1].Data)
108 {
109 this.Fields[1].Data = 0;
110 }
111
112 if (value)
113 {
114 this.Fields[1].Data = (int)this.Fields[1].Data | 0x4;
115 }
116 else
117 {
118 this.Fields[1].Data = (int)this.Fields[1].Data & ~0x4;
119 }
120 }
121 }
122 }
123}
diff --git a/src/WixToolset.Data/WindowsInstaller/Rows/WixSimpleReferenceRow.cs b/src/WixToolset.Data/WindowsInstaller/Rows/WixSimpleReferenceRow.cs
deleted file mode 100644
index bf7dfb0e..00000000
--- a/src/WixToolset.Data/WindowsInstaller/Rows/WixSimpleReferenceRow.cs
+++ /dev/null
@@ -1,61 +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
3namespace WixToolset.Data.WindowsInstaller.Rows
4{
5 using System;
6
7 /// <summary>
8 /// Specialization of a row for the WixSimpleReference table.
9 /// </summary>
10 public sealed class WixSimpleReferenceRow : Row
11 {
12 /// <summary>
13 /// Creates a WixSimpleReferenceRow that belongs to a table.
14 /// </summary>
15 /// <param name="sourceLineNumbers">Original source lines for this row.</param>
16 /// <param name="table">Table this row belongs to and should get its column definitions from.</param>
17 public WixSimpleReferenceRow(SourceLineNumber sourceLineNumbers, Table table)
18 : base(sourceLineNumbers, table)
19 {
20 }
21
22 /// <summary>
23 /// Creates a WixSimpleReferenceRow that belongs to a table.
24 /// </summary>
25 /// <param name="sourceLineNumbers">Original source lines for this row.</param>
26 /// <param name="tableDefinitions">Table definitions for this row.</param>
27 public WixSimpleReferenceRow(SourceLineNumber sourceLineNumbers, TableDefinition tableDefinitions)
28 : base(sourceLineNumbers, tableDefinitions)
29 {
30 }
31
32 /// <summary>
33 /// Gets or sets the primary keys of the simple reference.
34 /// </summary>
35 /// <value>The primary keys of the simple reference.</value>
36 public string PrimaryKeys
37 {
38 get { return (string)this.Fields[1].Data; }
39 set { this.Fields[1].Data = value; }
40 }
41
42 /// <summary>
43 /// Gets the symbolic name.
44 /// </summary>
45 /// <value>Symbolic name.</value>
46 public string SymbolicName
47 {
48 get { return String.Concat(this.TableName, ":", this.PrimaryKeys); }
49 }
50
51 /// <summary>
52 /// Gets or sets the table name of the simple reference.
53 /// </summary>
54 /// <value>The table name of the simple reference.</value>
55 public string TableName
56 {
57 get { return (string)this.Fields[0].Data; }
58 set { this.Fields[0].Data = value; }
59 }
60 }
61}