語言

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 方法找到特定的外掛。

Important

不支援允許不受信任的使用者或實體存取 PipelineSegments.store 與 Addins.store。 這樣做可能會導致應用程式的資料損壞。

方法

名稱 Description
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)

更新外掛快取,並在指定位置新增外掛。

適用於

另請參閱