AddInStore 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
提供用于存储和查找有关可用加载项和管道段的信息的方法。
public ref class AddInStore abstract sealed
public static class AddInStore
type AddInStore = class
Public Class AddInStore
- 继承
-
AddInStore
示例
以下示例演示如何更新缓存文件。
// Get path for the pipeline root.
// Assumes that the current directory is the
// pipeline directory structure root directory.
String pipeRoot = Environment.CurrentDirectory;
// Update the cache files of the
// pipeline segments and add-ins.
string[] warnings = AddInStore.Update(pipeRoot);
foreach (string warning in warnings)
{
Console.WriteLine(warning);
}
// Search for add-ins of type Calculator (the host view of the add-in)
// specifying the host's application base, instead of a path,
// for the FindAddIns method.
Collection<AddInToken> tokens =
AddInStore.FindAddIns(typeof(Calculator), PipelineStoreLocation.ApplicationBase);
' Get the path for the pipeline root.
' Assumes that the current directory is the
' pipline directory structure root directory.
Dim pipeRoot As String = Environment.CurrentDirectory
' Update the cache files of the
' pipeline segments and add-ins.
Dim warnings() As String = AddInStore.Update(pipeRoot)
For Each warning As String In warnings
Console.WriteLine(warning)
Next
' Search for add-ins of type Calculator (the host view of the add-in)
' specifying the host's application base, instead of a path,
' for the FindAddIns method.
Dim tokens As Collection(Of AddInToken) =
AddInStore.FindAddIns(GetType(Calculator), PipelineStoreLocation.ApplicationBase)
注解
使用此类生成、重新生成和更新两个缓存文件,如下表所述。
| 缓存文件 | 创建文件的方法 |
|---|---|
| PipelineSegments.store 此文件位于管道目录结构的根目录中。 |
Update 使用新的管道段更新文件。 如果未安装新段,此方法只会验证缓存。 Rebuild 重新生成文件并包括新的管道段。 |
| AddIns.store 此文件位于包含一个或多个外接程序子目录的目录中。 如果此目录位于管道目录结构中,则必须将其命名为 AddIns。 |
UpdateAddIns 使用指定位置的新加载项更新文件。 如果加载项位于管道目录结构之外,请调用此方法。 如果未安装任何新的加载项,此方法只会验证缓存。 RebuildAddIns 重新生成文件,并在指定位置包含加载项。 如果加载项位于管道目录结构之外,请调用此方法。 Update 如果外接程序位于管道目录结构中,此方法使用新的外接程序更新文件。 Rebuild 如果外接程序位于管道目录结构中,此方法将重新生成文件并包括新的外接程序。 |
这些方法创建缓存文件(如果以前不存在)。
创建缓存文件后,使用 FindAddIns 该方法检查文件以查找与外接程序的指定主机视图匹配的所有加载项。 还可以使用该方法 FindAddIn 查找特定的外接程序。
重要
不支持允许不受信任的用户或实体访问 PipelineSegments.store 和 Addins.store。 这样做可能会导致应用程序出现数据损坏问题。
方法
| 名称 | 说明 |
|---|---|
| FindAddIn(Type, String, String, String) |
查找特定的外接程序。 |
| FindAddIns(Type, PipelineStoreLocation, String[]) |
在值和可选加载项文件夹指定的 PipelineStoreLocation 位置查找外接程序的指定主机视图的所有加载项。 |
| FindAddIns(Type, PipelineStoreLocation) |
在枚举值指定的 PipelineStoreLocation 位置查找外接程序的指定主机视图的所有加载项。 |
| FindAddIns(Type, String, String[]) |
从指定的根目录查找外接程序的指定主机视图的所有加载项。 |
| Rebuild(PipelineStoreLocation) |
重新生成管道段缓存,并在值指定的 PipelineStoreLocation 位置包含新段。 |
| Rebuild(String) |
重新生成管道段缓存,并包括指定根目录中的新段。 |
| RebuildAddIns(String) |
重新生成外接程序缓存,并包括来自指定根目录的新加载项。 |
| Update(PipelineStoreLocation) |
使用值指定 PipelineStoreLocation 位置的新段更新管道段缓存。 |
| Update(String) |
使用指定根目录中的新段更新管道段缓存。 |
| UpdateAddIns(String) |
更新外接程序缓存,并在指定位置包含新的外接程序。 |