Bagikan melalui


AddInStore.FindAddIn(Type, String, String, String) Metode

Definisi

Menemukan add-in tertentu.

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)

Parameter

hostViewOfAddIn
Type

Jenis yang menentukan tampilan add-in host.

pipelineRootFolderPath
String

Jalur ke akar struktur direktori alur.

addInFilePath
String

Jalur dan nama file add-in untuk ditemukan.

addInTypeName
String

Nama jenis add-in.

Mengembalikan

Kumpulan token yang hanya berisi token yang mewakili add-in yang ditemukan.

Atribut

Pengecualian

Panjang pipelineRootFolderPath atau addInFilePath atau addInTypeName adalah 0.

-atau-

File add-in tidak ada di addInfilePath.

Satu atau beberapa parameter adalah null.

Pemanggil tidak memiliki izin akses baca ke pipelineRootFolderPath.

Contoh

Contoh berikut menemukan add-in tertentu.

// 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)

Keterangan

Jika satu alur untuk add-in ditemukan, itu akan menjadi satu-satunya item dalam AddInToken koleksi. Jika beberapa alur ke add-in yang ditentukan ditemukan, Anda dapat membedakannya dengan memeriksa QualificationData properti .

Berlaku untuk

Lihat juga