Partager via


IGuardedOperations.InvokeMatchingFactories<TExtensionInstance,TExtensionFactory,TMetadataView> Method

Definition

Safely invokes a delegate on all extension factories whose declared content type metadata matches the provided target content type.

public:
generic <typename TExtensionInstance, typename TExtensionFactory, typename TMetadataView>
 where TExtensionInstance : class where TExtensionFactory : class where TMetadataView : Microsoft::VisualStudio::Utilities::IContentTypeMetadata System::Collections::Generic::List<TExtensionInstance> ^ InvokeMatchingFactories(System::Collections::Generic::IEnumerable<Lazy<TExtensionFactory, TMetadataView> ^> ^ lazyFactories, Func<TExtensionFactory, TExtensionInstance> ^ getter, Microsoft::VisualStudio::Utilities::IContentType ^ dataContentType, System::Object ^ errorSource);
public System.Collections.Generic.List<TExtensionInstance> InvokeMatchingFactories<TExtensionInstance,TExtensionFactory,TMetadataView> (System.Collections.Generic.IEnumerable<Lazy<TExtensionFactory,TMetadataView>> lazyFactories, Func<TExtensionFactory,TExtensionInstance> getter, Microsoft.VisualStudio.Utilities.IContentType dataContentType, object errorSource) where TExtensionInstance : class where TExtensionFactory : class where TMetadataView : Microsoft.VisualStudio.Utilities.IContentTypeMetadata;
abstract member InvokeMatchingFactories : seq<Lazy<'ExtensionFactory, 'MetadataView>> * Func<'ExtensionFactory, 'ExtensionInstance (requires 'ExtensionFactory : null and 'ExtensionInstance : null)> * Microsoft.VisualStudio.Utilities.IContentType * obj -> System.Collections.Generic.List<'ExtensionInstance (requires 'ExtensionInstance : null)> (requires 'ExtensionInstance : null and 'ExtensionFactory : null and 'MetadataView :> Microsoft.VisualStudio.Utilities.IContentTypeMetadata)
Public Function InvokeMatchingFactories(Of TExtensionInstance As Class, TExtensionFactory As Class, TMetadataView As Class) (lazyFactories As IEnumerable(Of Lazy(Of TExtensionFactory, TMetadataView)), getter As Func(Of TExtensionFactory, TExtensionInstance), dataContentType As IContentType, errorSource As Object) As List(Of TExtensionInstance)

Type Parameters

TExtensionInstance
TExtensionFactory
TMetadataView

Parameters

lazyFactories
IEnumerable<Lazy<TExtensionFactory,TMetadataView>>

Lazy references that will be evaluated.

getter
Func<TExtensionFactory,TExtensionInstance>

Delegate which constructs an instance of the extension from each element of lazyFactories.

dataContentType
IContentType

Target content type.

errorSource
Object

Reference to the object that will be blamed for potential exceptions.

Returns

List<TExtensionInstance>

The list of results of getter.

Remarks

This class supports the Visual Studio infrastructure and in general is not intended to be used directly from your code.

Applies to