| 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.WindowsInstaller.Rows |
| 4 | { |
| 5 | /// <summary> |
| 6 | /// Specialization of a row for the Component table. |
| 7 | /// </summary> |
| 8 | public sealed class ComponentRow : Row |
| 9 | { |
| 10 | private string sourceFile; |
| 11 | |
| 12 | /// <summary> |
| 13 | /// Creates a Control row that belongs to a table. |
| 14 | /// </summary> |
| 15 | /// <param name="sourceLineNumbers">Original source lines for this row.</param> |
| 16 | /// <param name="table">Table this Component row belongs to and should get its column definitions from.</param> |
| 17 | public ComponentRow(SourceLineNumber sourceLineNumbers, Table table) : |
| 18 | base(sourceLineNumbers, table) |
| 19 | { |
| 20 | } |
| 21 | |
| 22 | public ComponentRow(SourceLineNumber sourceLineNumbers, TableDefinition tableDefinition) : |
| 23 | base(sourceLineNumbers, tableDefinition) |
| 24 | { |
| 25 | } |
| 26 | |
| 27 | /// <summary> |
| 28 | /// Gets or sets the identifier for this Component row. |
| 29 | /// </summary> |
| 30 | /// <value>Identifier for this Component row.</value> |
| 31 | public string Component |
| 32 | { |
| 33 | get { return (string)this.Fields[0].Data; } |
| 34 | set { this.Fields[0].Data = value; } |
| 35 | } |
| 36 | |
| 37 | /// <summary> |
| 38 | /// Gets or sets the ComponentId for this Component row. |
| 39 | /// </summary> |
| 40 | /// <value>guid for this Component row.</value> |
| 41 | public string Guid |
| 42 | { |
| 43 | get { return (string)this.Fields[1].Data; } |
| 44 | set { this.Fields[1].Data = value; } |
| 45 | } |
| 46 | |
| 47 | /// <summary> |
| 48 | /// Gets or sets the Directory_ of the Component. |
| 49 | /// </summary> |
| 50 | /// <value>Directory of the Component.</value> |
| 51 | public string Directory |
| 52 | { |
| 53 | get { return (string)this.Fields[2].Data; } |
| 54 | set { this.Fields[2].Data = value; } |
| 55 | } |
| 56 | |
| 57 | /// <summary> |
| 58 | /// Gets or sets the local only attribute of the Component. |
| 59 | /// </summary> |
| 60 | /// <value>Local only attribute of the component.</value> |
| 61 | public bool IsLocalOnly |
| 62 | { |
| 63 | get { return WindowsInstallerConstants.MsidbComponentAttributesLocalOnly == ((int)this.Fields[3].Data & WindowsInstallerConstants.MsidbComponentAttributesLocalOnly); } |
| 64 | set |
| 65 | { |
| 66 | if (value) |
| 67 | { |
| 68 | this.Fields[3].Data = (int)this.Fields[3].Data | WindowsInstallerConstants.MsidbComponentAttributesLocalOnly; |
| 69 | } |
| 70 | else |
| 71 | { |
| 72 | this.Fields[3].Data = (int)this.Fields[3].Data & ~WindowsInstallerConstants.MsidbComponentAttributesLocalOnly; |
| 73 | } |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | /// <summary> |
| 78 | /// Gets or sets the source only attribute of the Component. |
| 79 | /// </summary> |
| 80 | /// <value>Source only attribute of the component.</value> |
| 81 | public bool IsSourceOnly |
| 82 | { |
| 83 | get { return WindowsInstallerConstants.MsidbComponentAttributesSourceOnly == ((int)this.Fields[3].Data & WindowsInstallerConstants.MsidbComponentAttributesSourceOnly); } |
| 84 | set |
| 85 | { |
| 86 | if (value) |
| 87 | { |
| 88 | this.Fields[3].Data = (int)this.Fields[3].Data | WindowsInstallerConstants.MsidbComponentAttributesSourceOnly; |
| 89 | } |
| 90 | else |
| 91 | { |
| 92 | this.Fields[3].Data = (int)this.Fields[3].Data & ~WindowsInstallerConstants.MsidbComponentAttributesSourceOnly; |
| 93 | } |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | /// <summary> |
| 98 | /// Gets or sets the optional attribute of the Component. |
| 99 | /// </summary> |
| 100 | /// <value>Optional attribute of the component.</value> |
| 101 | public bool IsOptional |
| 102 | { |
| 103 | get { return WindowsInstallerConstants.MsidbComponentAttributesOptional == ((int)this.Fields[3].Data & WindowsInstallerConstants.MsidbComponentAttributesOptional); } |
| 104 | set |
| 105 | { |
| 106 | if (value) |
| 107 | { |
| 108 | this.Fields[3].Data = (int)this.Fields[3].Data | WindowsInstallerConstants.MsidbComponentAttributesOptional; |
| 109 | } |
| 110 | else |
| 111 | { |
| 112 | this.Fields[3].Data = (int)this.Fields[3].Data & ~WindowsInstallerConstants.MsidbComponentAttributesOptional; |
| 113 | } |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | /// <summary> |
| 118 | /// Gets or sets the registry key path attribute of the Component. |
| 119 | /// </summary> |
| 120 | /// <value>Registry key path attribute of the component.</value> |
| 121 | public bool IsRegistryKeyPath |
| 122 | { |
| 123 | get { return WindowsInstallerConstants.MsidbComponentAttributesRegistryKeyPath == ((int)this.Fields[3].Data & WindowsInstallerConstants.MsidbComponentAttributesRegistryKeyPath); } |
| 124 | set |
| 125 | { |
| 126 | if (value) |
| 127 | { |
| 128 | this.Fields[3].Data = (int)this.Fields[3].Data | WindowsInstallerConstants.MsidbComponentAttributesRegistryKeyPath; |
| 129 | } |
| 130 | else |
| 131 | { |
| 132 | this.Fields[3].Data = (int)this.Fields[3].Data & ~WindowsInstallerConstants.MsidbComponentAttributesRegistryKeyPath; |
| 133 | } |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | /// <summary> |
| 138 | /// Gets or sets the shared dll ref count attribute of the Component. |
| 139 | /// </summary> |
| 140 | /// <value>Shared dll ref countattribute of the component.</value> |
| 141 | public bool IsSharedDll |
| 142 | { |
| 143 | get { return WindowsInstallerConstants.MsidbComponentAttributesSharedDllRefCount == ((int)this.Fields[3].Data & WindowsInstallerConstants.MsidbComponentAttributesSharedDllRefCount); } |
| 144 | set |
| 145 | { |
| 146 | if (value) |
| 147 | { |
| 148 | this.Fields[3].Data = (int)this.Fields[3].Data | WindowsInstallerConstants.MsidbComponentAttributesSharedDllRefCount; |
| 149 | } |
| 150 | else |
| 151 | { |
| 152 | this.Fields[3].Data = (int)this.Fields[3].Data & ~WindowsInstallerConstants.MsidbComponentAttributesSharedDllRefCount; |
| 153 | } |
| 154 | } |
| 155 | } |
| 156 | |
| 157 | /// <summary> |
| 158 | /// Gets or sets the permanent attribute of the Component. |
| 159 | /// </summary> |
| 160 | /// <value>Permanent attribute of the component.</value> |
| 161 | public bool IsPermanent |
| 162 | { |
| 163 | get { return WindowsInstallerConstants.MsidbComponentAttributesPermanent == ((int)this.Fields[3].Data & WindowsInstallerConstants.MsidbComponentAttributesPermanent); } |
| 164 | set |
| 165 | { |
| 166 | if (value) |
| 167 | { |
| 168 | this.Fields[3].Data = (int)this.Fields[3].Data | WindowsInstallerConstants.MsidbComponentAttributesPermanent; |
| 169 | } |
| 170 | else |
| 171 | { |
| 172 | this.Fields[3].Data = (int)this.Fields[3].Data & ~WindowsInstallerConstants.MsidbComponentAttributesPermanent; |
| 173 | } |
| 174 | } |
| 175 | } |
| 176 | |
| 177 | /// <summary> |
| 178 | /// Gets or sets the ODBC data source key path attribute of the Component. |
| 179 | /// </summary> |
| 180 | /// <value>ODBC data source key path attribute of the component.</value> |
| 181 | public bool IsOdbcDataSourceKeyPath |
| 182 | { |
| 183 | get { return WindowsInstallerConstants.MsidbComponentAttributesODBCDataSource == ((int)this.Fields[3].Data & WindowsInstallerConstants.MsidbComponentAttributesODBCDataSource); } |
| 184 | set |
| 185 | { |
| 186 | if (value) |
| 187 | { |
| 188 | this.Fields[3].Data = (int)this.Fields[3].Data | WindowsInstallerConstants.MsidbComponentAttributesODBCDataSource; |
| 189 | } |
| 190 | else |
| 191 | { |
| 192 | this.Fields[3].Data = (int)this.Fields[3].Data & ~WindowsInstallerConstants.MsidbComponentAttributesODBCDataSource; |
| 193 | } |
| 194 | } |
| 195 | } |
| 196 | |
| 197 | /// <summary> |
| 198 | /// Gets or sets the 64 bit attribute of the Component. |
| 199 | /// </summary> |
| 200 | /// <value>64-bitness of the component.</value> |
| 201 | public bool Is64Bit |
| 202 | { |
| 203 | get { return WindowsInstallerConstants.MsidbComponentAttributes64bit == ((int)this.Fields[3].Data & WindowsInstallerConstants.MsidbComponentAttributes64bit); } |
| 204 | set |
| 205 | { |
| 206 | if (value) |
| 207 | { |
| 208 | this.Fields[3].Data = (int)this.Fields[3].Data | WindowsInstallerConstants.MsidbComponentAttributes64bit; |
| 209 | } |
| 210 | else |
| 211 | { |
| 212 | this.Fields[3].Data = (int)this.Fields[3].Data & ~WindowsInstallerConstants.MsidbComponentAttributes64bit; |
| 213 | } |
| 214 | } |
| 215 | } |
| 216 | |
| 217 | /// <summary> |
| 218 | /// Gets or sets the condition of the Component. |
| 219 | /// </summary> |
| 220 | /// <value>Condition of the Component.</value> |
| 221 | public string Condition |
| 222 | { |
| 223 | get { return (string)this.Fields[4].Data; } |
| 224 | set { this.Fields[4].Data = value; } |
| 225 | } |
| 226 | |
| 227 | /// <summary> |
| 228 | /// Gets or sets the key path of the Component. |
| 229 | /// </summary> |
| 230 | /// <value>Key path of the Component.</value> |
| 231 | public string KeyPath |
| 232 | { |
| 233 | get { return (string)this.Fields[5].Data; } |
| 234 | set { this.Fields[5].Data = value; } |
| 235 | } |
| 236 | |
| 237 | /// <summary> |
| 238 | /// Gets or sets the source location to the file to fill in the Text of the control. |
| 239 | /// </summary> |
| 240 | /// <value>Source location to the file to fill in the Text of the control.</value> |
| 241 | public string SourceFile |
| 242 | { |
| 243 | get { return this.sourceFile; } |
| 244 | set { this.sourceFile = value; } |
| 245 | } |
| 246 | } |
| 247 | } |