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

Definitie

Hiermee vindt u een specifieke invoegtoepassing.

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)

Parameters

hostViewOfAddIn
Type

Het type dat de weergave van de host van de invoegtoepassing definieert.

pipelineRootFolderPath
String

Het pad naar de hoofdmap van de structuur van de pijplijnmap.

addInFilePath
String

Het pad en de bestandsnaam van de invoegtoepassing die u kunt vinden.

addInTypeName
String

De typenaam van de invoegtoepassing.

Retouren

Een verzameling tokens die alleen het token bevat dat de gevonden invoegtoepassing vertegenwoordigt.

Kenmerken

Uitzonderingen

De lengte van pipelineRootFolderPath of addInFilePathaddInTypeName is 0.

– of –

Het invoegtoepassingsbestand bestaat niet in addInFilePath.

Een of meer parameters zijn null.

De beller heeft geen leestoegangsmachtiging voor pipelineRootFolderPath.

Voorbeelden

In het volgende voorbeeld wordt een specifieke invoegtoepassing gevonden.

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

Opmerkingen

Als er één pijplijn voor een invoegtoepassing wordt gevonden, is dit het enige item in de AddInToken verzameling. Als er meerdere pijplijnen naar de opgegeven invoegtoepassing worden gevonden, kunt u deze onderscheiden door de QualificationData eigenschap te onderzoeken.

Van toepassing op

Zie ook