Walkthrough: Linking a Content Type to a File Name Extension
You can define your own content type and link a file name extension to it by using editor Managed Extensibility Framework (MEF) extensions. In some cases, the file name extension has already been defined by a language service; nevertheless, to use it with MEF you still must link it to a content type.
To follow this walkthrough, you must install the Visual Studio 2010 SDK. For more information, see Visual Studio Integration SDK. To find out how to download the Visual Studio SDK, see Visual Studio Extensibility Developer Center on the MSDN Web site.
To create a MEF project
Create a C# or Visual Basic Editor Classifier project. Name the solution ContentTypeTest.
Open the source.extension.vsixmanifest file in the VSIX Manifest Editor.
Make sure that the Content heading contains a MEF Component content type and that the Path is set to ContentTypeTest.dll.
Save and close source.extension.vsixmanifest.
Delete the existing class files.
To define a content type
Add a class file and name it FileAndContentTypes.
Add the following using directives (Imports statements in Visual Basic).
Declare a static class (Module in Visual Basic) that contains the definitions.
In this class, export a ContentTypeDefinition named "hid" and declare its base definition to be "text".
To link a file name extension to a content type
To map this content type to a file name extension, export a FileExtensionToContentTypeDefinition that has the extension ".hid" and the content type "hid".