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 類型的所有載入宏。 然後,您可以使用傳 AddInToken 回集合中的其中一個標記,呼叫 Activate 類別的 AddInToken 方法來啟動特定的載入宏。

另請參閱

適用於