diff options
Diffstat (limited to 'src/WixToolset.Core.Burn/Bind/ProvidesDependency.cs')
-rw-r--r-- | src/WixToolset.Core.Burn/Bind/ProvidesDependency.cs | 110 |
1 files changed, 0 insertions, 110 deletions
diff --git a/src/WixToolset.Core.Burn/Bind/ProvidesDependency.cs b/src/WixToolset.Core.Burn/Bind/ProvidesDependency.cs deleted file mode 100644 index c7eba01c..00000000 --- a/src/WixToolset.Core.Burn/Bind/ProvidesDependency.cs +++ /dev/null | |||
@@ -1,110 +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.Core.Burn | ||
4 | { | ||
5 | using System; | ||
6 | using System.Xml; | ||
7 | using WixToolset.Data; | ||
8 | |||
9 | /// <summary> | ||
10 | /// Represents an authored or imported dependency provider. | ||
11 | /// </summary> | ||
12 | internal sealed class ProvidesDependency | ||
13 | { | ||
14 | #if TODO | ||
15 | /// <summary> | ||
16 | /// Creates a new instance of the <see cref="ProviderDependency"/> class from a <see cref="Row"/>. | ||
17 | /// </summary> | ||
18 | /// <param name="row">The <see cref="Row"/> from which data is imported.</param> | ||
19 | internal ProvidesDependency(Row row) | ||
20 | : this((string)row[2], (string)row[3], (string)row[4], (int?)row[5]) | ||
21 | { | ||
22 | } | ||
23 | #endif | ||
24 | |||
25 | /// <summary> | ||
26 | /// Creates a new instance of the <see cref="ProviderDependency"/> class. | ||
27 | /// </summary> | ||
28 | /// <param name="key">The unique key of the dependency.</param> | ||
29 | /// <param name="attributes">Additional attributes for the dependency.</param> | ||
30 | internal ProvidesDependency(string key, string version, string displayName, int? attributes) | ||
31 | { | ||
32 | this.Key = key; | ||
33 | this.Version = version; | ||
34 | this.DisplayName = displayName; | ||
35 | this.Attributes = attributes; | ||
36 | } | ||
37 | |||
38 | /// <summary> | ||
39 | /// Gets or sets the unique key of the package provider. | ||
40 | /// </summary> | ||
41 | internal string Key { get; set; } | ||
42 | |||
43 | /// <summary> | ||
44 | /// Gets or sets the version of the package provider. | ||
45 | /// </summary> | ||
46 | internal string Version { get; set; } | ||
47 | |||
48 | /// <summary> | ||
49 | /// Gets or sets the display name of the package provider. | ||
50 | /// </summary> | ||
51 | internal string DisplayName { get; set; } | ||
52 | |||
53 | /// <summary> | ||
54 | /// Gets or sets the attributes for the dependency. | ||
55 | /// </summary> | ||
56 | internal int? Attributes { get; set; } | ||
57 | |||
58 | /// <summary> | ||
59 | /// Gets or sets whether the dependency was imported from the package. | ||
60 | /// </summary> | ||
61 | internal bool Imported { get; set; } | ||
62 | |||
63 | /// <summary> | ||
64 | /// Gets whether certain properties are the same. | ||
65 | /// </summary> | ||
66 | /// <param name="other">Another <see cref="ProvidesDependency"/> to compare.</param> | ||
67 | /// <remarks>This is not the same as object equality, but only checks a subset of properties | ||
68 | /// to determine if the objects are similar and could be merged into a collection.</remarks> | ||
69 | /// <returns>True if certain properties are the same.</returns> | ||
70 | internal bool Equals(ProvidesDependency other) | ||
71 | { | ||
72 | if (null != other) | ||
73 | { | ||
74 | return this.Key == other.Key && | ||
75 | this.Version == other.Version && | ||
76 | this.DisplayName == other.DisplayName; | ||
77 | } | ||
78 | |||
79 | return false; | ||
80 | } | ||
81 | |||
82 | /// <summary> | ||
83 | /// Writes the dependency to the bundle XML manifest. | ||
84 | /// </summary> | ||
85 | /// <param name="writer">The <see cref="XmlTextWriter"/> for the bundle XML manifest.</param> | ||
86 | internal void WriteXml(XmlTextWriter writer) | ||
87 | { | ||
88 | writer.WriteStartElement("Provides"); | ||
89 | writer.WriteAttributeString("Key", this.Key); | ||
90 | |||
91 | if (!String.IsNullOrEmpty(this.Version)) | ||
92 | { | ||
93 | writer.WriteAttributeString("Version", this.Version); | ||
94 | } | ||
95 | |||
96 | if (!String.IsNullOrEmpty(this.DisplayName)) | ||
97 | { | ||
98 | writer.WriteAttributeString("DisplayName", this.DisplayName); | ||
99 | } | ||
100 | |||
101 | if (this.Imported) | ||
102 | { | ||
103 | // The package dependency was explicitly authored into the manifest. | ||
104 | writer.WriteAttributeString("Imported", "yes"); | ||
105 | } | ||
106 | |||
107 | writer.WriteEndElement(); | ||
108 | } | ||
109 | } | ||
110 | } | ||