How to: Create an Editor (C#)
The Visual Studio Integration Package Wizard creates a boilerplate implementation of a simple VSPackage given the company name, the VSPackage name, and the VSPackage version number. The wizard can also add code to the VSPackage to create a simple editor.
To create a VSPackage using the Visual Studio Integration Package Wizard
On the File menu, point to New, and then click Project.
In the New Project dialog box, expand Other Project Types, and click Extensibility Projects.
In the Templates pane click Visual Studio Integration Package.
In the Location box, type the file path for your VSPackage.
In the Name box, type the name for the solution and click OK to start the wizard.
On the Select a Programming Language page, select C#. Have the wizard generate a key.snk file to sign the assembly. Alternately, Browse to your own key file. The wizard makes a copy of your key file and names it key.snk.
Specify details about your VSPackage in the Basic VSPackage Information page. Provide the VSPackage name, the name of your company, and the version information in the respective boxes. The VSPackage name is written into the system registry. It can also appear in the Help About dialog box, and on the Visual Studio splash screen. The version information is written into the registry and can appear in the Help About dialog box.
Click the Change Icon button to select an icon for the splash screen.
Select an icon from the Change Icon dialog box, or browse to an ico file in another location. Only ico files are supported.
In the Detailed Info box, type additional information that you want to display in the Help About dialog box.
Select the minimum edition of Visual Studio you want your VSPackage to support.
Click Next to specify options for your VSPackage, or click Finish to create a boilerplate VSPackage.
Select the Custom Editor option to create a custom editor for your VSPackage. When the Custom Editor option is selected, the Editor Options page is displayed.
Type the name of your editor in the Editor Name box. Type the file extension that you want to be associated with your editor in the File Extension box. Your editor is available to be a Visual Studio editor for files with this extension. The file extension is registered in the Visual Studio integrated development environment (IDE) only and not in the larger Windows environment. Type the default file name for new documents created with your editor in the Default File Name box. Click the Change Icon button to select, or browse for, an icon that is associated with your editor window and your new editor file type.
Click Finish to create your VSPackage in the folder that you specified.
To test your custom editor
On the File menu, point to New and then click File.
In the Categories pane of the New File dialog box, select the file type you generated with the Visual Studio Integration Package Wizard.
Click Open to view and edit the document.
The editor supports cut-and-paste, find-and-replace, and open-and-load operations.
Compiling the Code
Projects generated with the wizard have embedded paths that refer to utilities like Regpkg.exe. To use them on another machine, you need to ensure the paths match.