AddInStore.FindAddIn(Type, String, String, String) Yöntem

Tanım

Belirli bir eklentiyi bulur.

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)

Parametreler

hostViewOfAddIn
Type

Konağın eklenti görünümünü tanımlayan tür.

pipelineRootFolderPath
String

İşlem hattı dizin yapısının köküne giden yol.

addInFilePath
String

Bulunacak eklentinin yolu ve dosya adı.

addInTypeName
String

Eklentinin tür adı.

Döndürülenler

Yalnızca bulunan eklentiyi temsil eden belirteci içeren belirteç koleksiyonu.

Öznitelikler

Özel durumlar

veya addInFilePathaddInTypeName uzunluğu pipelineRootFolderPath 0'dır.

-veya-

Eklenti dosyası içinde addInfilePathyok.

Bir veya daha fazla parametre şeklindedir null.

Çağıranın için pipelineRootFolderPathokuma erişimi izni yok.

Örnekler

Aşağıdaki örnek belirli bir eklentiyi bulur.

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

Açıklamalar

Bir eklenti için tek bir işlem hattı bulunursa, koleksiyondaki AddInToken tek öğe bu olur. Belirtilen eklentide birden çok işlem hattı bulunursa, özelliğini inceleyerek QualificationData bunları ayırt edebilirsiniz.

Şunlara uygulanır

Ayrıca bkz.