AddInStore.FindAddIn(Type, String, String, String) メソッド

定義

特定のアドインを検索します。Finds a specific add-in.

public:
 static System::Collections::ObjectModel::Collection<System::AddIn::Hosting::AddInToken ^> ^ FindAddIn(Type ^ hostViewOfAddIn, System::String ^ pipelineRootFolderPath, System::String ^ addInFilePath, System::String ^ addInTypeName);
[System.Security.SecurityCritical]
public static System.Collections.ObjectModel.Collection<System.AddIn.Hosting.AddInToken> FindAddIn (Type hostViewOfAddIn, string pipelineRootFolderPath, string addInFilePath, string addInTypeName);
static member FindAddIn : Type * string * string * string -> System.Collections.ObjectModel.Collection<System.AddIn.Hosting.AddInToken>
Public Shared Function FindAddIn (hostViewOfAddIn As Type, pipelineRootFolderPath As String, addInFilePath As String, addInTypeName As String) As Collection(Of AddInToken)

パラメーター

hostViewOfAddIn
Type

ホストのアドイン ビューを定義する型。The type that defines the host's view of the add-in.

pipelineRootFolderPath
String

パイプライン ディレクトリ構造のルート パス。The path to the root of the pipeline directory structure.

addInFilePath
String

検索するアドインのパスとファイル名。The path and file name of the add-in to find.

addInTypeName
String

アドインの型の名前。The type name of the add-in.

戻り値

Collection<AddInToken>

トークンのコレクション。見つかったアドインを表すトークンのみが格納されています。A collection of tokens that contains only the token representing the add-in that was found.

属性

例外

pipelineRootFolderPathaddInFilePath、または addInTypeName の長さが 0 です。The length of pipelineRootFolderPath or addInFilePath or addInTypeName is 0.

- または --or- このアドイン ファイルは addInfilePath に存在しません。The add-in file does not exist in addInfilePath.

1 つ以上のパラメーターが null です。One or more parameters are null.

呼び出し元に、pipelineRootFolderPath への読み取りアクセス許可がありません。The caller does not have read access permission to pipelineRootFolderPath.

次の例では、特定のアドインを検索します。The following example finds a specific add-in.

// Find a specific add-in.

// Construct the path to the add-in.
string addInFilePath = pipeRoot + @"\AddIns\P3AddIn2\P3AddIn2.dll";

// The fourth parameter, addinTypeName, takes the full name
// of the type qualified by its namespace. Same as AddInToken.AddInFullName.
Collection<AddInToken> tokenColl = AddInStore.FindAddIn(typeof(Calculator),
    pipeRoot, addInFilePath, "CalcAddIns.P3AddIn2");
Console.WriteLine("Found {0}", tokenColl[0].Name);
' Find a specific add-in.
' Construct the path to the add-in.
Dim addInFilePath As String = (pipeRoot + "\AddIns\P3AddIn2\P3AddIn2.dll")
' The fourth parameter, addinTypeName, takes the full name 
' of the type qualified by its namespace. Same as AddInToken.AddInFullName.
Dim tokenColl As System.Collections.ObjectModel.Collection(Of AddInToken) = AddInStore.FindAddIn(GetType(Calculator), pipeRoot, addInFilePath, "CalcAddIns.P3AddIn2")
Console.WriteLine("Found {0}", tokenColl(0).Name)

注釈

アドインの1つのパイプラインが見つかった場合は、AddInToken コレクション内の唯一の項目になります。If a single pipeline for an add-in is found, it will be the only item in the AddInToken collection. 指定されたアドインに対して複数のパイプラインが見つかった場合は、QualificationData プロパティを調べることで区別できます。If multiple pipelines to the specified add-in are found, you can differentiate them by examining the QualificationData property.

適用対象

こちらもご覧ください