Export (0) Print
Expand All

AddInStore.FindAddIn Method

Updated: September 2010

Finds a specific add-in.

Namespace:  System.AddIn.Hosting
Assembly:  System.AddIn (in System.AddIn.dll)

public static Collection<AddInToken> FindAddIn(
	Type hostViewOfAddIn,
	string pipelineRootFolderPath,
	string addInFilePath,
	string addInTypeName
)

Parameters

hostViewOfAddIn
Type: System.Type

The type that defines the host's view of the add-in.

pipelineRootFolderPath
Type: System.String

The path to the root of the pipeline directory structure.

addInFilePath
Type: System.String

The path and file name of the add-in to find.

addInTypeName
Type: System.String

The type name of the add-in.

Return Value

Type: System.Collections.ObjectModel.Collection<AddInToken>
A collection of tokens that contains only the token representing the add-in that was found.

If a single pipeline for an add-in is found, it will be the only item in the AddInToken collection. If multiple pipelines to the specified add-in are found, you can differentiate them by examining the QualificationData property.

The following example finds a specific add-in.

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

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5

Date

History

Reason

September 2010

Corrected the description of addInTypeName.

Customer feedback.

Community Additions

ADD
Show:
© 2014 Microsoft