VSIX Extensibility
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
resources
src
LICENSE
README.md

README.md

VSExtensibilityHelper

Basic useful feature list:

Services:

  • DteService
  • MsgBoxService
  • PaneService
  • ServiceLocator

Core:

  • BaseEditorFactory
  • BaseEditorPane
  • BaseWinFormsEditorPane
  • BaseWpfEditorPane

Making custom VSIX Editor for "*.myExtension" files example:

 public sealed class WinFormsEditorFactory 
 	: BaseEditorFactory<WinFormsEditorEditorPane>
{
}

public class WinFormsEditorEditorPane 
	: BaseWinFormsEditorPane<WinFormsEditorFactory, Controls.WinForms.WinFormUserControl>
{
	#region Methods

    protected override string GetFileExtension()
    {
    	return ".myExtension";
    }
    protected override void LoadFile(string fileName)
    {}
	protected override void SaveFile(string fileName)
    {}    

    #endregion Methods
}

Package registration:

 [ProvideEditorExtension(typeof(Editors.WinFormsEditorFactory), ".myExtension", 50,
      ProjectGuid = "7D346946-3421-48C0-A98A-20790CB68B3C", NameResourceID = 133,
      TemplateDir = @".\NullPath")]
public sealed class VSPackageCustomEditors : Package
{
 	protected override void Initialize()
	{
        base.Initialize();

            /*
             * Registering editor with WinForms control
             * *.myExtension
             */
            base.RegisterEditorFactory(new Editors.WinFormsEditorFactory()); 
    }
}

Sample project

\src\VSIXProject_Editor

Result

image

image

Based on:

License

This project is licensed under the MIT License