次の方法で共有


IGuardedOperations.InvokeEligibleFactories<TExtensionInstance,TExtensionFactory,TMetadataView> Method

Definition

Safely invokes a delegate on all extension factories whose declared content type metadata matches the provided target content type, taking into account that extension factory may be disabled by a Replace attribute on another factory.

public:
generic <typename TExtensionInstance, typename TExtensionFactory, typename TMetadataView>
 where TExtensionInstance : class where TExtensionFactory : class where TMetadataView : Microsoft::VisualStudio::Utilities::INamedContentTypeMetadata System::Collections::Generic::List<TExtensionInstance> ^ InvokeEligibleFactories(System::Collections::Generic::IEnumerable<Lazy<TExtensionFactory, TMetadataView> ^> ^ lazyFactories, Func<TExtensionFactory, TExtensionInstance> ^ getter, Microsoft::VisualStudio::Utilities::IContentType ^ dataContentType, Microsoft::VisualStudio::Utilities::IContentTypeRegistryService ^ contentTypeRegistryService, System::Object ^ errorSource);
public System.Collections.Generic.List<TExtensionInstance> InvokeEligibleFactories<TExtensionInstance,TExtensionFactory,TMetadataView> (System.Collections.Generic.IEnumerable<Lazy<TExtensionFactory,TMetadataView>> lazyFactories, Func<TExtensionFactory,TExtensionInstance> getter, Microsoft.VisualStudio.Utilities.IContentType dataContentType, Microsoft.VisualStudio.Utilities.IContentTypeRegistryService contentTypeRegistryService, object errorSource) where TExtensionInstance : class where TExtensionFactory : class where TMetadataView : Microsoft.VisualStudio.Utilities.INamedContentTypeMetadata;
abstract member InvokeEligibleFactories : seq<Lazy<'ExtensionFactory, 'MetadataView>> * Func<'ExtensionFactory, 'ExtensionInstance (requires 'ExtensionFactory : null and 'ExtensionInstance : null)> * Microsoft.VisualStudio.Utilities.IContentType * Microsoft.VisualStudio.Utilities.IContentTypeRegistryService * obj -> System.Collections.Generic.List<'ExtensionInstance (requires 'ExtensionInstance : null)> (requires 'ExtensionInstance : null and 'ExtensionFactory : null and 'MetadataView :> Microsoft.VisualStudio.Utilities.INamedContentTypeMetadata)
Public Function InvokeEligibleFactories(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, contentTypeRegistryService As IContentTypeRegistryService, 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.

contentTypeRegistryService
IContentTypeRegistryService

Instance of IContentTypeRegistryService which orders content types.

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