AddInStore 類別

定義

提供用來儲存及尋找可用增益集和管線區段相關資訊的方法。

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)

PipelineStoreLocation 列舉值所指定的位置,尋找增益集之指定主應用程式檢視的所有增益集。

FindAddIns(Type, PipelineStoreLocation, String[])

PipelineStoreLocation 值和選擇性增益集資料夾所指定的位置上,尋找指定之增益集主應用程式檢視的所有增益集。

FindAddIns(Type, String, String[])

從指定的根目錄中,尋找指定之增益集主應用程式檢視的所有增益集。

Rebuild(PipelineStoreLocation)

PipelineStoreLocation 值所指定的位置上,重建管線區段快取,並且包含新區段。

Rebuild(String)

重建管線區段快取,並且包含指定之根目錄中的新區段。

RebuildAddIns(String)

重建增益集快取,並且包含指定之根目錄中的新增益集。

Update(PipelineStoreLocation)

PipelineStoreLocation 值所指定的位置上,以新區段更新管線區段快取。

Update(String)

以指定之根目錄中的新區段,更新管線區段快取。

UpdateAddIns(String)

在指定位置上更新增益集快取,並且包含新的增益集。

適用於

另請參閱