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

Definice

Najde konkrétní doplněk.

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)

Parametry

hostViewOfAddIn
Type

Typ, který definuje zobrazení hostitele doplňku.

pipelineRootFolderPath
String

Cesta ke kořenovému adresáři struktury kanálu.

addInFilePath
String

Cesta a název souboru doplňku, který chcete najít.

addInTypeName
String

Název typu doplňku.

Návraty

Kolekce tokenů, která obsahuje pouze token představující nalezený doplněk.

Atributy

Výjimky

Délka nebo pipelineRootFolderPathaddInFilePathaddInTypeName je 0.

-nebo-

Soubor doplňku neexistuje v nástroji addInfilePath.

Jeden nebo více parametrů je null.

Volající nemá oprávnění ke čtení pro pipelineRootFolderPath.

Příklady

Následující příklad najde konkrétní doplněk.

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

Poznámky

Pokud se najde jeden kanál pro doplněk, bude to jediná položka v kolekci AddInToken . Pokud se najde více kanálů k zadanému doplňku, můžete je odlišit prozkoumáním QualificationData vlastnosti .

Platí pro

Viz také