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

Definición

Busca un complemento concreto.

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)

Parámetros

hostViewOfAddIn
Type

Tipo que define la vista del host del complemento.

pipelineRootFolderPath
String

Ruta de acceso a la raíz de la estructura de directorios de canalizaciones.

addInFilePath
String

Ruta de acceso y nombre de archivo del complemento que se va a buscar.

addInTypeName
String

Nombre del tipo del complemento.

Devoluciones

Colección de tokens, que contiene sólo el token que representa el complemento buscado.

Atributos

Excepciones

La longitud de pipelineRootFolderPath o addInFilePath o addInTypeName es 0.

o bien

El archivo de complemento no existe en addInfilePath.

Uno o varios parámetros son null.

El llamador no tiene permiso de acceso de lectura a pipelineRootFolderPath.

Ejemplos

En el ejemplo siguiente se busca un complemento específico.

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

Comentarios

Si se encuentra una sola canalización para un complemento, será el único elemento de la AddInToken colección. Si se encuentran varias canalizaciones en el complemento especificado, puede diferenciarlas examinando la QualificationData propiedad .

Se aplica a

Consulte también