From 2bb37beda887d120a0ddabf874ad25357101faa1 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Wed, 1 Nov 2017 10:59:45 -0700 Subject: Update to WiX Intermediate Representation --- .../Rows/ComponentRow.cs | 245 +++++++++++++++++++++ 1 file changed, 245 insertions(+) create mode 100644 src/WixToolset.Data.WindowsInstaller/Rows/ComponentRow.cs (limited to 'src/WixToolset.Data.WindowsInstaller/Rows/ComponentRow.cs') diff --git a/src/WixToolset.Data.WindowsInstaller/Rows/ComponentRow.cs b/src/WixToolset.Data.WindowsInstaller/Rows/ComponentRow.cs new file mode 100644 index 00000000..3ff10175 --- /dev/null +++ b/src/WixToolset.Data.WindowsInstaller/Rows/ComponentRow.cs @@ -0,0 +1,245 @@ +// 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. + +namespace WixToolset.Data.Rows +{ + using System; + using WixToolset.Data.Msi; + + /// + /// Specialization of a row for the Component table. + /// + public sealed class ComponentRow : Row + { + private string sourceFile; + + /// + /// Creates a Control row that belongs to a table. + /// + /// Original source lines for this row. + /// Table this Component row belongs to and should get its column definitions from. + public ComponentRow(SourceLineNumber sourceLineNumbers, Table table) : + base(sourceLineNumbers, table) + { + } + + /// + /// Gets or sets the identifier for this Component row. + /// + /// Identifier for this Component row. + public string Component + { + get { return (string)this.Fields[0].Data; } + set { this.Fields[0].Data = value; } + } + + /// + /// Gets or sets the ComponentId for this Component row. + /// + /// guid for this Component row. + public string Guid + { + get { return (string)this.Fields[1].Data; } + set { this.Fields[1].Data = value; } + } + + /// + /// Gets or sets the Directory_ of the Component. + /// + /// Directory of the Component. + public string Directory + { + get { return (string)this.Fields[2].Data; } + set { this.Fields[2].Data = value; } + } + + /// + /// Gets or sets the local only attribute of the Component. + /// + /// Local only attribute of the component. + public bool IsLocalOnly + { + get { return MsiInterop.MsidbComponentAttributesLocalOnly == ((int)this.Fields[3].Data & MsiInterop.MsidbComponentAttributesLocalOnly); } + set + { + if (value) + { + this.Fields[3].Data = (int)this.Fields[3].Data | MsiInterop.MsidbComponentAttributesLocalOnly; + } + else + { + this.Fields[3].Data = (int)this.Fields[3].Data & ~MsiInterop.MsidbComponentAttributesLocalOnly; + } + } + } + + /// + /// Gets or sets the source only attribute of the Component. + /// + /// Source only attribute of the component. + public bool IsSourceOnly + { + get { return MsiInterop.MsidbComponentAttributesSourceOnly == ((int)this.Fields[3].Data & MsiInterop.MsidbComponentAttributesSourceOnly); } + set + { + if (value) + { + this.Fields[3].Data = (int)this.Fields[3].Data | MsiInterop.MsidbComponentAttributesSourceOnly; + } + else + { + this.Fields[3].Data = (int)this.Fields[3].Data & ~MsiInterop.MsidbComponentAttributesSourceOnly; + } + } + } + + /// + /// Gets or sets the optional attribute of the Component. + /// + /// Optional attribute of the component. + public bool IsOptional + { + get { return MsiInterop.MsidbComponentAttributesOptional == ((int)this.Fields[3].Data & MsiInterop.MsidbComponentAttributesOptional); } + set + { + if (value) + { + this.Fields[3].Data = (int)this.Fields[3].Data | MsiInterop.MsidbComponentAttributesOptional; + } + else + { + this.Fields[3].Data = (int)this.Fields[3].Data & ~MsiInterop.MsidbComponentAttributesOptional; + } + } + } + + /// + /// Gets or sets the registry key path attribute of the Component. + /// + /// Registry key path attribute of the component. + public bool IsRegistryKeyPath + { + get { return MsiInterop.MsidbComponentAttributesRegistryKeyPath == ((int)this.Fields[3].Data & MsiInterop.MsidbComponentAttributesRegistryKeyPath); } + set + { + if (value) + { + this.Fields[3].Data = (int)this.Fields[3].Data | MsiInterop.MsidbComponentAttributesRegistryKeyPath; + } + else + { + this.Fields[3].Data = (int)this.Fields[3].Data & ~MsiInterop.MsidbComponentAttributesRegistryKeyPath; + } + } + } + + /// + /// Gets or sets the shared dll ref count attribute of the Component. + /// + /// Shared dll ref countattribute of the component. + public bool IsSharedDll + { + get { return MsiInterop.MsidbComponentAttributesSharedDllRefCount == ((int)this.Fields[3].Data & MsiInterop.MsidbComponentAttributesSharedDllRefCount); } + set + { + if (value) + { + this.Fields[3].Data = (int)this.Fields[3].Data | MsiInterop.MsidbComponentAttributesSharedDllRefCount; + } + else + { + this.Fields[3].Data = (int)this.Fields[3].Data & ~MsiInterop.MsidbComponentAttributesSharedDllRefCount; + } + } + } + + /// + /// Gets or sets the permanent attribute of the Component. + /// + /// Permanent attribute of the component. + public bool IsPermanent + { + get { return MsiInterop.MsidbComponentAttributesPermanent == ((int)this.Fields[3].Data & MsiInterop.MsidbComponentAttributesPermanent); } + set + { + if (value) + { + this.Fields[3].Data = (int)this.Fields[3].Data | MsiInterop.MsidbComponentAttributesPermanent; + } + else + { + this.Fields[3].Data = (int)this.Fields[3].Data & ~MsiInterop.MsidbComponentAttributesPermanent; + } + } + } + + /// + /// Gets or sets the ODBC data source key path attribute of the Component. + /// + /// ODBC data source key path attribute of the component. + public bool IsOdbcDataSourceKeyPath + { + get { return MsiInterop.MsidbComponentAttributesODBCDataSource == ((int)this.Fields[3].Data & MsiInterop.MsidbComponentAttributesODBCDataSource); } + set + { + if (value) + { + this.Fields[3].Data = (int)this.Fields[3].Data | MsiInterop.MsidbComponentAttributesODBCDataSource; + } + else + { + this.Fields[3].Data = (int)this.Fields[3].Data & ~MsiInterop.MsidbComponentAttributesODBCDataSource; + } + } + } + + /// + /// Gets or sets the 64 bit attribute of the Component. + /// + /// 64-bitness of the component. + public bool Is64Bit + { + get { return MsiInterop.MsidbComponentAttributes64bit == ((int)this.Fields[3].Data & MsiInterop.MsidbComponentAttributes64bit); } + set + { + if (value) + { + this.Fields[3].Data = (int)this.Fields[3].Data | MsiInterop.MsidbComponentAttributes64bit; + } + else + { + this.Fields[3].Data = (int)this.Fields[3].Data & ~MsiInterop.MsidbComponentAttributes64bit; + } + } + } + + /// + /// Gets or sets the condition of the Component. + /// + /// Condition of the Component. + public string Condition + { + get { return (string)this.Fields[4].Data; } + set { this.Fields[4].Data = value; } + } + + /// + /// Gets or sets the key path of the Component. + /// + /// Key path of the Component. + public string KeyPath + { + get { return (string)this.Fields[5].Data; } + set { this.Fields[5].Data = value; } + } + + /// + /// Gets or sets the source location to the file to fill in the Text of the control. + /// + /// Source location to the file to fill in the Text of the control. + public string SourceFile + { + get { return this.sourceFile; } + set { this.sourceFile = value; } + } + } +} -- cgit v1.2.3-55-g6feb