// 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.WindowsInstaller.Rows { /// /// 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 WindowsInstallerConstants.MsidbComponentAttributesLocalOnly == ((int)this.Fields[3].Data & WindowsInstallerConstants.MsidbComponentAttributesLocalOnly); } set { if (value) { this.Fields[3].Data = (int)this.Fields[3].Data | WindowsInstallerConstants.MsidbComponentAttributesLocalOnly; } else { this.Fields[3].Data = (int)this.Fields[3].Data & ~WindowsInstallerConstants.MsidbComponentAttributesLocalOnly; } } } /// /// Gets or sets the source only attribute of the Component. /// /// Source only attribute of the component. public bool IsSourceOnly { get { return WindowsInstallerConstants.MsidbComponentAttributesSourceOnly == ((int)this.Fields[3].Data & WindowsInstallerConstants.MsidbComponentAttributesSourceOnly); } set { if (value) { this.Fields[3].Data = (int)this.Fields[3].Data | WindowsInstallerConstants.MsidbComponentAttributesSourceOnly; } else { this.Fields[3].Data = (int)this.Fields[3].Data & ~WindowsInstallerConstants.MsidbComponentAttributesSourceOnly; } } } /// /// Gets or sets the optional attribute of the Component. /// /// Optional attribute of the component. public bool IsOptional { get { return WindowsInstallerConstants.MsidbComponentAttributesOptional == ((int)this.Fields[3].Data & WindowsInstallerConstants.MsidbComponentAttributesOptional); } set { if (value) { this.Fields[3].Data = (int)this.Fields[3].Data | WindowsInstallerConstants.MsidbComponentAttributesOptional; } else { this.Fields[3].Data = (int)this.Fields[3].Data & ~WindowsInstallerConstants.MsidbComponentAttributesOptional; } } } /// /// Gets or sets the registry key path attribute of the Component. /// /// Registry key path attribute of the component. public bool IsRegistryKeyPath { get { return WindowsInstallerConstants.MsidbComponentAttributesRegistryKeyPath == ((int)this.Fields[3].Data & WindowsInstallerConstants.MsidbComponentAttributesRegistryKeyPath); } set { if (value) { this.Fields[3].Data = (int)this.Fields[3].Data | WindowsInstallerConstants.MsidbComponentAttributesRegistryKeyPath; } else { this.Fields[3].Data = (int)this.Fields[3].Data & ~WindowsInstallerConstants.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 WindowsInstallerConstants.MsidbComponentAttributesSharedDllRefCount == ((int)this.Fields[3].Data & WindowsInstallerConstants.MsidbComponentAttributesSharedDllRefCount); } set { if (value) { this.Fields[3].Data = (int)this.Fields[3].Data | WindowsInstallerConstants.MsidbComponentAttributesSharedDllRefCount; } else { this.Fields[3].Data = (int)this.Fields[3].Data & ~WindowsInstallerConstants.MsidbComponentAttributesSharedDllRefCount; } } } /// /// Gets or sets the permanent attribute of the Component. /// /// Permanent attribute of the component. public bool IsPermanent { get { return WindowsInstallerConstants.MsidbComponentAttributesPermanent == ((int)this.Fields[3].Data & WindowsInstallerConstants.MsidbComponentAttributesPermanent); } set { if (value) { this.Fields[3].Data = (int)this.Fields[3].Data | WindowsInstallerConstants.MsidbComponentAttributesPermanent; } else { this.Fields[3].Data = (int)this.Fields[3].Data & ~WindowsInstallerConstants.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 WindowsInstallerConstants.MsidbComponentAttributesODBCDataSource == ((int)this.Fields[3].Data & WindowsInstallerConstants.MsidbComponentAttributesODBCDataSource); } set { if (value) { this.Fields[3].Data = (int)this.Fields[3].Data | WindowsInstallerConstants.MsidbComponentAttributesODBCDataSource; } else { this.Fields[3].Data = (int)this.Fields[3].Data & ~WindowsInstallerConstants.MsidbComponentAttributesODBCDataSource; } } } /// /// Gets or sets the 64 bit attribute of the Component. /// /// 64-bitness of the component. public bool Is64Bit { get { return WindowsInstallerConstants.MsidbComponentAttributes64bit == ((int)this.Fields[3].Data & WindowsInstallerConstants.MsidbComponentAttributes64bit); } set { if (value) { this.Fields[3].Data = (int)this.Fields[3].Data | WindowsInstallerConstants.MsidbComponentAttributes64bit; } else { this.Fields[3].Data = (int)this.Fields[3].Data & ~WindowsInstallerConstants.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; } } } }