summaryrefslogtreecommitdiff
path: root/src/tools/Dtf/Inventory/IInventoryDataProvider.cs
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2022-07-14 15:19:53 -0700
committerRob Mensching <rob@firegiant.com>2022-07-14 16:02:24 -0700
commit229242cf7c328b89b5aa65ed7a04e33c8b93b393 (patch)
treede0a9547e73e46490b0946d6850228d5b30258b8 /src/tools/Dtf/Inventory/IInventoryDataProvider.cs
parentf46ca6a9dce91607ffc9855270dd6998216e1a8b (diff)
downloadwix-229242cf7c328b89b5aa65ed7a04e33c8b93b393.tar.gz
wix-229242cf7c328b89b5aa65ed7a04e33c8b93b393.tar.bz2
wix-229242cf7c328b89b5aa65ed7a04e33c8b93b393.zip
Rename "samples" segment to "tools"
This segment is a bit of a "miscellaneous section" in the WiX repo. As such it has been difficult to name. I originally eschewed the name "tools" because what is in the "wix" segment was once called "tools". However, now that wix.exe is firmly established as the entry point for WiX operations, I've become comfortable with its segment being named "wix". That meant "tools" was again available and "tools" better describes the content of this section.
Diffstat (limited to 'src/tools/Dtf/Inventory/IInventoryDataProvider.cs')
-rw-r--r--src/tools/Dtf/Inventory/IInventoryDataProvider.cs67
1 files changed, 67 insertions, 0 deletions
diff --git a/src/tools/Dtf/Inventory/IInventoryDataProvider.cs b/src/tools/Dtf/Inventory/IInventoryDataProvider.cs
new file mode 100644
index 00000000..affcb358
--- /dev/null
+++ b/src/tools/Dtf/Inventory/IInventoryDataProvider.cs
@@ -0,0 +1,67 @@
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
3using System;
4using System.Data;
5
6namespace WixToolset.Dtf.Tools.Inventory
7{
8 /// <summary>
9 /// Reports the total number of items loaded so far by <see cref="IInventoryDataProvider.GetNodes"/>.
10 /// </summary>
11 public delegate void InventoryDataLoadStatusCallback(int itemsLoaded, string currentNode);
12
13 /// <summary>
14 /// Inventory data providers implement this interface to provide a particular type of data.
15 /// Implementors must provide a parameterless constructor.
16 /// </summary>
17 public interface IInventoryDataProvider
18 {
19 /// <summary>
20 /// Gets a description of the data provided. This description allows
21 /// the user to choose what type of data to gather.
22 /// </summary>
23 string Description { get; }
24
25 /// <summary>
26 /// Gets the paths of all nodes for which this object provides data.
27 /// </summary>
28 /// <param name="statusCallback">Callback for reporting status.
29 /// The callback should not necessarily be invoked for every individual
30 /// node loaded, rather only every significant chunk.</param>
31 /// <returns>An array of node paths. The parts of the node paths
32 /// are delimited by backslashes (\).</returns>
33 string[] GetNodes(InventoryDataLoadStatusCallback statusCallback);
34
35 /// <summary>
36 /// When related nodes of a tree consist of duplicate data, it's
37 /// inefficient to search them all. This method indicates which
38 /// nodes should be search and which should be ignored.
39 /// </summary>
40 /// <param name="searchRoot">Root node of the subtree-search.</param>
41 /// <param name="searchNode">Node which may or may not be searched.</param>
42 /// <returns>True if the node should be searched, false otherwise.</returns>
43 bool IsNodeSearchable(string searchRoot, string searchNode);
44
45 /// <summary>
46 /// Gets the data for a particular node.
47 /// </summary>
48 /// <param name="nodePath">Path of the node for which data is requested.
49 /// This is one of the paths returned by <see cref="GetNodes"/>.</param>
50 /// <returns>DataView of a table filled with data, or null if data is
51 /// not available.</returns>
52 DataView GetData(string nodePath);
53
54 /// <summary>
55 /// Gets the path of another node which provides more details about
56 /// a particular data row.
57 /// </summary>
58 /// <param name="nodePath">Path of the node containing the data
59 /// row being queried.</param>
60 /// <param name="row">Data row being queried.</param>
61 /// <returns>Path to another node. This is not necessarily
62 /// one of the nodes returned by <see cref="GetNodes"/>. If the
63 /// node path is unknown, it will be ignored. This method may
64 /// return null if there is no detail node for the row.</returns>
65 string GetLink(string nodePath, DataRow row);
66 }
67}