项目作者: d-kochanzhi

项目描述 :
VSIX Extensibility
高级语言: C
项目地址: git://github.com/d-kochanzhi/VSExtensibilityHelper.git
创建时间: 2017-10-13T13:32:36Z
项目社区:https://github.com/d-kochanzhi/VSExtensibilityHelper

开源协议:MIT License

下载


VSExtensibilityHelper

Basic useful feature list:

Services:

  • DteService
  • MsgBoxService
  • PaneService
  • ServiceLocator

    Core:

  • BaseEditorFactory

  • BaseEditorPane
  • BaseWinFormsEditorPane
  • BaseWpfEditorPane

Making custom VSIX Editor for “*.myExtension” files example:

  1. public sealed class WinFormsEditorFactory
  2. : BaseEditorFactory<WinFormsEditorEditorPane>
  3. {
  4. }
  5. public class WinFormsEditorEditorPane
  6. : BaseWinFormsEditorPane<WinFormsEditorFactory, Controls.WinForms.WinFormUserControl>
  7. {
  8. #region Methods
  9. protected override string GetFileExtension()
  10. {
  11. return ".myExtension";
  12. }
  13. protected override void LoadFile(string fileName)
  14. {}
  15. protected override void SaveFile(string fileName)
  16. {}
  17. #endregion Methods
  18. }

Package registration:

  1. [ProvideEditorExtension(typeof(Editors.WinFormsEditorFactory), ".myExtension", 50,
  2. ProjectGuid = "7D346946-3421-48C0-A98A-20790CB68B3C", NameResourceID = 133,
  3. TemplateDir = @".\NullPath")]
  4. public sealed class VSPackageCustomEditors : Package
  5. {
  6. protected override void Initialize()
  7. {
  8. base.Initialize();
  9. /*
  10. * Registering editor with WinForms control
  11. * *.myExtension
  12. */
  13. base.RegisterEditorFactory(new Editors.WinFormsEditorFactory());
  14. }
  15. }

Sample project

\src\VSIXProject_Editor

Result

image

image

Based on:

License

This project is licensed under the MIT License