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

Definition

Söker efter ett specifikt tillägg.

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)

Parametrar

hostViewOfAddIn
Type

Den typ som definierar värdens vy över tillägget.

pipelineRootFolderPath
String

Sökvägen till roten i pipelinekatalogstrukturen.

addInFilePath
String

Sökvägen och filnamnet för tillägget som ska hittas.

addInTypeName
String

Typnamnet för tillägget.

Returer

En samling token som endast innehåller den token som representerar tillägget som hittades.

Attribut

Undantag

Längden på pipelineRootFolderPath eller addInFilePath eller addInTypeName är 0.

-eller-

Tilläggsfilen finns inte i addInFilePath.

En eller flera parametrar är null.

Anroparen har inte läsbehörighet till pipelineRootFolderPath.

Exempel

I följande exempel hittar du ett specifikt tillägg.

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

Kommentarer

Om en enda pipeline för ett tillägg hittas är det det enda objektet i AddInToken samlingen. Om flera pipelines till det angivna tillägget hittas kan du särskilja dem genom att QualificationData undersöka egenskapen.

Gäller för

Se även