| 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.Extensibility.Services |
| 4 | { |
| 5 | using WixToolset.Data; |
| 6 | using WixToolset.Data.Symbols; |
| 7 | using WixToolset.Data.WindowsInstaller; |
| 8 | using WixToolset.Data.WindowsInstaller.Rows; |
| 9 | using WixToolset.Extensibility.Data; |
| 10 | |
| 11 | /// <summary> |
| 12 | /// Interface provided to help Windows Installer backend extensions. |
| 13 | /// </summary> |
| 14 | public interface IWindowsInstallerBackendHelper : IBackendHelper |
| 15 | { |
| 16 | /// <summary> |
| 17 | /// Creates a file facade from a <c>FileSymbol</c>. |
| 18 | /// </summary> |
| 19 | /// <param name="file"><c>FileSymbol</c> backing the facade.</param> |
| 20 | /// <returns></returns> |
| 21 | IFileFacade CreateFileFacade(FileSymbol file); |
| 22 | |
| 23 | /// <summary> |
| 24 | /// Creates a file facade from a File row. |
| 25 | /// </summary> |
| 26 | /// <param name="fileRow"><c>FileRow</c></param> |
| 27 | /// <returns>New <c>IFileFacade</c>.</returns> |
| 28 | IFileFacade CreateFileFacade(FileRow fileRow); |
| 29 | |
| 30 | /// <summary> |
| 31 | /// Creates a <see cref="Row"/> in the specified table. |
| 32 | /// </summary> |
| 33 | /// <param name="section">Parent section.</param> |
| 34 | /// <param name="symbol">Symbol with line information for the row.</param> |
| 35 | /// <param name="data">Windows Installer data.</param> |
| 36 | /// <param name="tableDefinition">Table definition for the row.</param> |
| 37 | /// <returns>Row created in the <paramref name="data"/>.</returns> |
| 38 | Row CreateRow(IntermediateSection section, IntermediateSymbol symbol, WindowsInstallerData data, TableDefinition tableDefinition); |
| 39 | |
| 40 | /// <summary> |
| 41 | /// Looks up the registered <see cref="TableDefinition"/> for the given <see cref="IntermediateSymbol"/> and creates a <see cref="Row"/> in that table. |
| 42 | /// Goes sequentially through each field in the symbol and assigns the value to the column with the same index as the field. |
| 43 | /// If the symbol's Id is registered as the primary key then that is used for the first column and the column data is offset by 1. |
| 44 | /// </summary> |
| 45 | /// <param name="section">Parent section.</param> |
| 46 | /// <param name="symbol">Symbol to create the row from.</param> |
| 47 | /// <param name="data">Windows Installer data.</param> |
| 48 | /// <param name="tableDefinitions">Table definitions that have been registered with the binder.</param> |
| 49 | /// <returns>True if a row was created.</returns> |
| 50 | bool TryAddSymbolToMatchingTableDefinitions(IntermediateSection section, IntermediateSymbol symbol, WindowsInstallerData data, TableDefinitionCollection tableDefinitions); |
| 51 | } |
| 52 | } |