AddInStore.FindAddIns Method

Definition

Finds all add-ins for a specified host view of the add-in.

Overloads

FindAddIns(Type, PipelineStoreLocation)

Finds all add-ins for a specified host view of the add-in at a location specified by the PipelineStoreLocation enumeration value.

FindAddIns(Type, PipelineStoreLocation, String[])

Finds all add-ins for a specified host view of the add-in at the location specified by a PipelineStoreLocation value and an optional add-ins folder.

FindAddIns(Type, String, String[])

Finds all add-ins for a specified host view of the add-in from a specified root directory.

FindAddIns(Type, PipelineStoreLocation)

Finds all add-ins for a specified host view of the add-in at a location specified by the PipelineStoreLocation enumeration value.

C#
[System.Security.SecurityCritical]
[System.Security.SecurityTreatAsSafe]
public static System.Collections.ObjectModel.Collection<System.AddIn.Hosting.AddInToken> FindAddIns(Type hostViewOfAddIn, System.AddIn.Hosting.PipelineStoreLocation location);
C#
public static System.Collections.ObjectModel.Collection<System.AddIn.Hosting.AddInToken> FindAddIns(Type hostViewOfAddIn, System.AddIn.Hosting.PipelineStoreLocation location);

Parameters

hostViewOfAddIn
Type

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

location
PipelineStoreLocation

The host application's base directory.

Returns

A collection of tokens that represent the add-ins that were found.

Attributes

Exceptions

There is an access violation to the pipeline directory structure.

location is an invalid PipelineStoreLocation value.

Examples

The following example finds add-ins at the location specified by the PipelineStoreLocation enumeration.

C#
// Search for add-ins of type Calculator (the host view of the add-in)
// specifying the host's application base, instead of a path,
// for the FindAddIns method.

Collection<AddInToken> tokens =
            AddInStore.FindAddIns(typeof(Calculator), PipelineStoreLocation.ApplicationBase);

Remarks

The PipelineStoreLocation enumeration currently contains only the ApplicationBase value, which points to the host's application base directory.

Applies to

.NET Framework 4.8.1 a ďalšie verzie
Produkt Verzie
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

FindAddIns(Type, PipelineStoreLocation, String[])

Finds all add-ins for a specified host view of the add-in at the location specified by a PipelineStoreLocation value and an optional add-ins folder.

C#
[System.Security.SecurityCritical]
public static System.Collections.ObjectModel.Collection<System.AddIn.Hosting.AddInToken> FindAddIns(Type hostViewOfAddIn, System.AddIn.Hosting.PipelineStoreLocation location, params string[] addInFolderPaths);

Parameters

hostViewOfAddIn
Type

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

location
PipelineStoreLocation

One of the enumeration values.

Currently the only value in this enumeration is the directory specified by the ApplicationBase property that was used to set up the host's application domain.

addInFolderPaths
String[]

(Optional). The path of the directory that contains one or more subdirectories of add-ins. Because this parameter takes an array of strings, you can specify more than one path.

This parameter is not required if your add-ins are located in the pipeline directory structure under the AddIns folder.

Returns

A collection of tokens that represent the add-ins that were found.

Attributes

Exceptions

There is an access violation to the pipeline directory structure.

location is an invalid PipelineStoreLocation value.

Remarks

Use this method overload to enable a partially trusted host, which may not have path discovery permission to discover its own location, to find add-ins in its own directory.

Applies to

.NET Framework 4.8.1 a ďalšie verzie
Produkt Verzie
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

FindAddIns(Type, String, String[])

Finds all add-ins for a specified host view of the add-in from a specified root directory.

C#
[System.Security.SecurityCritical]
public static System.Collections.ObjectModel.Collection<System.AddIn.Hosting.AddInToken> FindAddIns(Type hostViewOfAddIn, string pipelineRootFolderPath, params string[] addInFolderPaths);

Parameters

hostViewOfAddIn
Type

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

pipelineRootFolderPath
String

The path of the root of the pipeline directory structure.

addInFolderPaths
String[]

(Optional). The path of the directory that contains one or more subdirectories of add-ins. Because this parameter takes an array of strings, you can specify more than one path.

This parameter is not required if your add-ins are located in the pipeline directory structure under the AddIns folder.

Returns

A collection of tokens that represent the add-ins that were found.

Attributes

Exceptions

There is an access violation to the pipeline directory structure.

Remarks

This method examines the store files of cached add-in and pipeline segment information to find all add-ins that match a specified hostAddInView type. You can then use one of the tokens in the returned AddInToken collection to activate a specific add-in by calling the Activate method of the AddInToken class.

See also

Applies to

.NET Framework 4.8.1 a ďalšie verzie
Produkt Verzie
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1