次の方法で共有


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

定義

特定のアドインを検索します。

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);
[<System.Security.SecurityCritical>]
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

アドインのホストのビューを定義する型。

pipelineRootFolderPath
String

パイプライン ディレクトリ構造のルートへのパス。

addInFilePath
String

検索するアドインのパスとファイル名。

addInTypeName
String

アドインの型名。

戻り値

見つかったアドインを表すトークンのみを含むトークンのコレクション。

属性

例外

pipelineRootFolderPathまたはaddInFilePathまたはaddInTypeNameの長さは 0 です。

-又は-

アドイン ファイルが addInFilePathに存在しません。

1 つ以上のパラメーターが null

呼び出し元には、 pipelineRootFolderPathに対する読み取りアクセス許可がありません。

次の例では、特定のアドインを検索します。

// 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 コレクション内の唯一の項目になります。 指定したアドインに対する複数のパイプラインが見つかった場合は、 QualificationData プロパティを調べることで区別できます。

適用対象

こちらもご覧ください