aboutsummaryrefslogtreecommitdiff
path: root/src/dtf/WixToolset.Dtf.WindowsInstaller/InstallationPart.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/dtf/WixToolset.Dtf.WindowsInstaller/InstallationPart.cs82
1 files changed, 82 insertions, 0 deletions
diff --git a/src/dtf/WixToolset.Dtf.WindowsInstaller/InstallationPart.cs b/src/dtf/WixToolset.Dtf.WindowsInstaller/InstallationPart.cs
new file mode 100644
index 00000000..ce5a6a94
--- /dev/null
+++ b/src/dtf/WixToolset.Dtf.WindowsInstaller/InstallationPart.cs
@@ -0,0 +1,82 @@
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.Dtf.WindowsInstaller
4{
5 /// <summary>
6 /// Subclasses of this abstract class represent an instance
7 /// of a registered feature or component.
8 /// </summary>
9 public abstract class InstallationPart
10 {
11 private string id;
12 private string productCode;
13 private string userSid;
14 private UserContexts context;
15
16 internal InstallationPart(string id, string productCode)
17 : this(id, productCode, null, UserContexts.None)
18 {
19 }
20
21 internal InstallationPart(string id, string productCode, string userSid, UserContexts context)
22 {
23 this.id = id;
24 this.productCode = productCode;
25 this.userSid = userSid;
26 this.context = context;
27 }
28
29 internal string Id
30 {
31 get
32 {
33 return this.id;
34 }
35 }
36
37 internal string ProductCode
38 {
39 get
40 {
41 return this.productCode;
42 }
43 }
44
45 internal string UserSid
46 {
47 get
48 {
49 return this.userSid;
50 }
51 }
52
53 internal UserContexts Context
54 {
55 get
56 {
57 return this.context;
58 }
59 }
60
61 /// <summary>
62 /// Gets the product that this item is a part of.
63 /// </summary>
64 public ProductInstallation Product
65 {
66 get
67 {
68 return this.productCode != null ?
69 new ProductInstallation(this.productCode, userSid, context) : null;
70 }
71 }
72
73 /// <summary>
74 /// Gets the current installation state of the item.
75 /// </summary>
76 public abstract InstallState State
77 {
78 get;
79 }
80 }
81
82}