AddInStore.FindAddIn(Type, String, String, String) Méthode

Définition

Recherche un complément spécifique.

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)

Paramètres

hostViewOfAddIn
Type

Type qui définit la vue de l'hôte du complément.

pipelineRootFolderPath
String

Chemin d'accès à la racine de la structure de répertoires du pipeline.

addInFilePath
String

Chemin d'accès et nom de fichier du complément à rechercher.

addInTypeName
String

Nom de type du complément.

Retours

Collection de jetons qui contient uniquement le jeton représentant le complément trouvé.

Attributs

Exceptions

La longueur de pipelineRootFolderPath, de addInFilePath ou de addInTypeName est égale à zéro.

- ou -

Le fichier de complément n'existe pas dans addInfilePath.

Au moins un paramètre a la valeur null.

L'appelant ne dispose pas de l'autorisation en lecture sur pipelineRootFolderPath.

Exemples

L’exemple suivant recherche un complément spécifique.

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

Remarques

Si un pipeline unique pour un complément est trouvé, il s’agit du seul élément de la AddInToken collection. Si plusieurs pipelines vers le complément spécifié sont trouvés, vous pouvez les différencier en examinant la QualificationData propriété .

S’applique à

Voir aussi