ICommonEditorAssetServiceFactory Interface
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Service for getting a service that provides common language service elements.
public interface class ICommonEditorAssetServiceFactory
public interface ICommonEditorAssetServiceFactory
type ICommonEditorAssetServiceFactory = interface
Public Interface ICommonEditorAssetServiceFactory
Examples
This is a MEF component part. Use the code below in your MEF exported class to import an instance of the service factory.
[Import]
private ICommonEditorAssetServiceFactory assetServiceFactory = null;
Then, you can use the code below to get the ITaggerProvider for the Common Editor's IClassificationTagger. Modify as needed to get the desired asset.
var factory = this.assetServiceFactory.GetOrCreate(buffer);
var tagger = factory.FindAsset<ITaggerProvider>(
(metadata) => metadata.TagTypes.Any(tagType => typeof(IClassificationTagger).IsAssignableFrom(tagType)))
?.CreateTagger<T>(buffer);
Remarks
This class supports the Visual Studio infrastructure and in general is not intended to be used directly from your code.
Methods
GetOrCreate(ITextBuffer) |
Gets a service that provides common language service elements. |