AddInStore.FindAddIns 方法

定义

查找外接程序的指定宿主视图的所有外接程序。

重载

FindAddIns(Type, PipelineStoreLocation)

在由 PipelineStoreLocation 枚举值指定的位置查找外接程序的指定宿主视图的所有外接程序。

FindAddIns(Type, PipelineStoreLocation, String[])

在由 PipelineStoreLocation 值指定的位置和可选外接程序文件夹中查找外接程序的指定宿主视图的所有外接程序。

FindAddIns(Type, String, String[])

从指定根目录中查找外接程序的指定宿主视图的所有外接程序。

FindAddIns(Type, PipelineStoreLocation)

在由 PipelineStoreLocation 枚举值指定的位置查找外接程序的指定宿主视图的所有外接程序。

public:
 static System::Collections::ObjectModel::Collection<System::AddIn::Hosting::AddInToken ^> ^ FindAddIns(Type ^ hostViewOfAddIn, System::AddIn::Hosting::PipelineStoreLocation ___location);
[System.Security.SecurityCritical]
[System.Security.SecurityTreatAsSafe]
public static System.Collections.ObjectModel.Collection<System.AddIn.Hosting.AddInToken> FindAddIns (Type hostViewOfAddIn, System.AddIn.Hosting.PipelineStoreLocation ___location);
public static System.Collections.ObjectModel.Collection<System.AddIn.Hosting.AddInToken> FindAddIns (Type hostViewOfAddIn, System.AddIn.Hosting.PipelineStoreLocation ___location);
[<System.Security.SecurityCritical>]
[<System.Security.SecurityTreatAsSafe>]
static member FindAddIns : Type * System.AddIn.Hosting.PipelineStoreLocation -> System.Collections.ObjectModel.Collection<System.AddIn.Hosting.AddInToken>
static member FindAddIns : Type * System.AddIn.Hosting.PipelineStoreLocation -> System.Collections.ObjectModel.Collection<System.AddIn.Hosting.AddInToken>
Public Shared Function FindAddIns (hostViewOfAddIn As Type, ___location As PipelineStoreLocation) As Collection(Of AddInToken)

参数

hostViewOfAddIn
Type

用于定义外接程序宿主视图的类型。

___location
PipelineStoreLocation

宿主应用程序的基目录。

返回

表示已找到的外接程序的标记的集合。

属性

例外

存在管线目录结构访问冲突。

___location 不是有效的 PipelineStoreLocation 值。

示例

以下示例在 枚举指定 PipelineStoreLocation 的位置查找外接程序。

// 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);
' 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)

注解

枚举 PipelineStoreLocation 当前仅 ApplicationBase 包含 值,该值指向主机的应用程序基目录。

适用于

FindAddIns(Type, PipelineStoreLocation, String[])

在由 PipelineStoreLocation 值指定的位置和可选外接程序文件夹中查找外接程序的指定宿主视图的所有外接程序。

public:
 static System::Collections::ObjectModel::Collection<System::AddIn::Hosting::AddInToken ^> ^ FindAddIns(Type ^ hostViewOfAddIn, System::AddIn::Hosting::PipelineStoreLocation ___location, ... cli::array <System::String ^> ^ addInFolderPaths);
[System.Security.SecurityCritical]
public static System.Collections.ObjectModel.Collection<System.AddIn.Hosting.AddInToken> FindAddIns (Type hostViewOfAddIn, System.AddIn.Hosting.PipelineStoreLocation ___location, params string[] addInFolderPaths);
[<System.Security.SecurityCritical>]
static member FindAddIns : Type * System.AddIn.Hosting.PipelineStoreLocation * string[] -> System.Collections.ObjectModel.Collection<System.AddIn.Hosting.AddInToken>
Public Shared Function FindAddIns (hostViewOfAddIn As Type, ___location As PipelineStoreLocation, ParamArray addInFolderPaths As String()) As Collection(Of AddInToken)

参数

hostViewOfAddIn
Type

用于定义外接程序宿主视图的类型。

___location
PipelineStoreLocation

枚举值之一。

目前,此枚举中仅有的值是由用于设置主机应用程序域的 ApplicationBase 属性所指定的目录。

addInFolderPaths
String[]

(可选)。 包含一个或多个加载项子目录的目录的路径。因为此参数接受字符串数组,所以可以指定多个路径。

如果外接程序位于管线目录结构中 AddIns 文件夹内,则不需要此参数。

返回

表示已找到的外接程序的标记的集合。

属性

例外

存在管线目录结构访问冲突。

___location 不是有效的 PipelineStoreLocation 值。

注解

使用此方法重载可使部分受信任的主机(该主机可能没有路径发现权限来发现自己的位置)在自己的目录中查找加载项。

适用于

FindAddIns(Type, String, String[])

从指定根目录中查找外接程序的指定宿主视图的所有外接程序。

public:
 static System::Collections::ObjectModel::Collection<System::AddIn::Hosting::AddInToken ^> ^ FindAddIns(Type ^ hostViewOfAddIn, System::String ^ pipelineRootFolderPath, ... cli::array <System::String ^> ^ addInFolderPaths);
[System.Security.SecurityCritical]
public static System.Collections.ObjectModel.Collection<System.AddIn.Hosting.AddInToken> FindAddIns (Type hostViewOfAddIn, string pipelineRootFolderPath, params string[] addInFolderPaths);
[<System.Security.SecurityCritical>]
static member FindAddIns : Type * string * string[] -> System.Collections.ObjectModel.Collection<System.AddIn.Hosting.AddInToken>
Public Shared Function FindAddIns (hostViewOfAddIn As Type, pipelineRootFolderPath As String, ParamArray addInFolderPaths As String()) As Collection(Of AddInToken)

参数

hostViewOfAddIn
Type

用于定义外接程序宿主视图的类型。

pipelineRootFolderPath
String

管线目录结构的根目录的路径。

addInFolderPaths
String[]

(可选)。 包含一个或多个加载项子目录的目录的路径。因为此参数接受字符串数组,所以可以指定多个路径。

如果外接程序位于管线目录结构中 AddIns 文件夹内,则不需要此参数。

返回

表示已找到的外接程序的标记的集合。

属性

例外

存在管线目录结构访问冲突。

注解

此方法检查缓存外接程序和管道段信息的存储文件,以查找与指定 hostAddInView 类型匹配的所有外接程序。 然后,可以通过调用 Activate 类的 方法AddInToken,使用返回AddInToken的集合中的标记之一来激活特定外接程序。

另请参阅

适用于